home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Magazine / GraphicsCards / Warp3D / Developer / Docs / Warp3D.doc < prev    next >
Text File  |  1999-02-05  |  116KB  |  3,387 lines

  1. TABLE OF CONTENTS
  2.  
  3. Warp3D/W3D_AllocStencilBuffer
  4. Warp3D/W3D_AllocTexObj
  5. Warp3D/W3D_AllocZBuffer
  6. Warp3D/W3D_CheckDriver
  7. Warp3D/W3D_CheckIdle
  8. Warp3D/W3D_ClearStencilBuffer
  9. Warp3D/W3D_ClearZBuffer
  10. Warp3D/W3D_CreateContext
  11. Warp3D/W3D_DestroyContext
  12. Warp3D/W3D_DrawLine
  13. Warp3D/W3D_DrawLineLoop
  14. Warp3D/W3D_DrawLineStrip
  15. Warp3D/W3D_DrawPoint
  16. Warp3D/W3D_DrawTriangle
  17. Warp3D/W3D_DrawTriFan
  18. Warp3D/W3D_DrawTriStrip
  19. Warp3D/W3D_FillStencilBuffer
  20. Warp3D/W3D_Flush
  21. Warp3D/W3D_FlushFrame
  22. Warp3D/W3D_FlushTextures
  23. Warp3D/W3D_FreeAllTexObj
  24. Warp3D/W3D_FreeStencilBuffer
  25. Warp3D/W3D_FreeTexObj
  26. Warp3D/W3D_FreeZBuffer
  27. Warp3D/W3D_GetDestFmt
  28. Warp3D/W3D_GetDrivers
  29. Warp3D/W3D_GetDriverState
  30. Warp3D/W3D_GetDriverTexFmtInfo
  31. Warp3D/W3D_GetState
  32. Warp3D/W3D_GetTexFmtInfo
  33. Warp3D/W3D_Hint
  34. Warp3D/W3D_LockHardware
  35. Warp3D/W3D_Query
  36. Warp3D/W3D_QueryDriver
  37. Warp3D/W3D_ReadStencilPixel
  38. Warp3D/W3D_ReadStencilSpan
  39. Warp3D/W3D_ReadZPixel
  40. Warp3D/W3D_ReadZSpan
  41. Warp3D/W3D_ReleaseTexture
  42. Warp3D/W3D_RequestMode
  43. Warp3D/W3D_SetAlphaMode
  44. Warp3D/W3D_SetBlendMode
  45. Warp3D/W3D_SetColorMask
  46. Warp3D/W3D_SetCurrentColor
  47. Warp3D/W3D_SetCurrentPen
  48. Warp3D/W3D_SetDrawRegion
  49. Warp3D/W3D_SetDrawRegionWBM
  50. Warp3D/W3D_SetFilter
  51. Warp3D/W3D_SetFogParams
  52. Warp3D/W3D_SetLogicOp
  53. Warp3D/W3D_SetPenMask
  54. Warp3D/W3D_SetScissor
  55. Warp3D/W3D_SetState
  56. Warp3D/W3D_SetStencilFunc
  57. Warp3D/W3D_SetStencilOp
  58. Warp3D/W3D_SetTexEnv
  59. Warp3D/W3D_SetWrapMode
  60. Warp3D/W3D_SetWriteMask
  61. Warp3D/W3D_SetZCompareMode
  62. Warp3D/W3D_TestMode
  63. Warp3D/W3D_UnLockHardware
  64. Warp3D/W3D_UpdateTexImage
  65. Warp3D/W3D_UpdateTexSubImage
  66. Warp3D/W3D_UploadTexture
  67. Warp3D/W3D_WaitIdle
  68. Warp3D/W3D_WriteStencilPixel
  69. Warp3D/W3D_WriteStencilSpan
  70. Warp3D/W3D_WriteZPixel
  71. Warp3D/W3D_WriteZSpan
  72. Warp3D/W3D_AllocStencilBuffer                          Warp3D/W3D_AllocStencilBuffer
  73.  
  74.    NAME   
  75.        W3D_AllocStencilBuffer -- Allocate stencil buffer
  76.  
  77.    SYNOPSIS
  78.        success =  W3D_AllocStencilBuffer(context);
  79.        d0                                a0
  80.  
  81.        ULONG W3D_AllocStencilBuffer(W3D_Context *);
  82.  
  83.    FUNCTION
  84.        Allocate a stencil buffer for the given context. For more
  85.        information on stencil buffering, see the OpenGL specs.
  86.  
  87.    INPUTS
  88.        context - The context the stencil buffer is allocated on
  89.  
  90.    RESULT
  91.        One of the following values:
  92.            W3D_SUCCESS         The allocation was successful
  93.            W3D_NOGFXMEM        No memory was left on the graphics board
  94.            W3D_NOSTENCILBUFFER Stencil buffering is not available
  95.  
  96.    EXAMPLE
  97.  
  98.    NOTES
  99.        Stencil buffering and the ViRGE: The ViRGE is not capable of stencil
  100.        buffering, it became a necessity later when hardware accelerators
  101.        started to support the OpenGL standard.
  102.  
  103.    BUGS
  104.  
  105.    SEE ALSO
  106.        W3D_FreeStencilBuffer
  107.  
  108. Warp3D/W3D_AllocTexObj                                        Warp3D/W3D_AllocTexObj
  109.  
  110.    NAME   
  111.        W3D_AllocTexObj -- Allocate a new texture object
  112.  
  113.    SYNOPSIS
  114.        texture = W3D_AllocTexObj(context, error, ATOTags);
  115.        d0                        a0       a1     a2
  116.  
  117.        W3D_Texture *W3D_AllocTexObj(W3D_Context, ULONG *, struct TagItem *);
  118.  
  119.    FUNCTION
  120.        Create a new texture object. Such a texture object contains
  121.        information about a texture in addition to the normal image data
  122.        that is displayed.
  123.  
  124.    INPUTS
  125.        context - pointer to a W3D_Context
  126.        error   - pointer to a ULONG, which will contain an error code,
  127.                    or NULL if you do not want to get the error code.
  128.        ATOTags - pointer to a taglist. Supported tags are:
  129.                    W3D_ATO_IMAGE (mandatory):
  130.                          A pointer to the source texture image
  131.                    W3D_ATO_FORMAT (mandatory):
  132.                          The texture format of the source texture. Must be
  133.                          one of the following values (check the include file
  134.                          for more precise definition):
  135.                          - W3D_CHUNKY
  136.                          - W3D_A1R5G5B5
  137.                          - W3D_R5G6B5
  138.                          - W3D_R8G8B8
  139.                          - W3D_A4R4G4B4
  140.                          - W3D_A8R8G8B8
  141.                          - W3D_R8G8B8A8
  142.                          - W3D_A8
  143.                          - W3D_L8
  144.                          - W3D_L8A8
  145.                          - W3D_I8
  146.                    W3D_ATO_WIDTH (mandatory):
  147.                          The width of the texture in pixels. Must
  148.                          be 2^n.
  149.                    W3D_ATO_HEIGHT (mandatory):
  150.                          The height of the texture in pixels. Must
  151.                          be 2^n.
  152.                    W3D_ATO_MIPMAP (optional):
  153.                          If specified, the texture can be used for mipmapping.
  154.                          The value of this tag defines, which mipmap levels
  155.                          have to be generated automatically. It should be set
  156.                          so that the generated mipmaps and the provided ones
  157.                          build a complete mipmap set.
  158.                          The value is a bitmask with one specific bit
  159.                          representing a mipmap level. Bit 0 corresponds to
  160.                          level 1, Bit 1 to level 2, so Bit n to level n-1.
  161.                          A value of 0 means, that all mipmaps are provided
  162.                          by the application.
  163.                          Note, that providing only a part of all mipmaps
  164.                          which leave holes between the provided levels may
  165.                          result in performance loss.
  166.                    W3D_ATO_MIPMAPPTRS (mandatory for user-supplied mipmaps)
  167.                          If W3D_ATO_MIPMAP is specified, mipmapping is used
  168.                          for texturing. The mipmap mask specifies which of the
  169.                          mipmaps will be created. With the W3D_ATO_MIPMAPPTRS tag,
  170.                          an array of (void *) to the mipmaps you want to
  171.                          supply yourself is defined. This array must be
  172.                          NULL-Terminated
  173.                          Example: You want to give only level 3 and 5, and
  174.                          let W3D_AllocTexObj create the rest of the mipmaps.
  175.                          Assume a 128x128 texture (7 mipmap levels)
  176.                          Define an array like this:
  177.                            void *mips[3];
  178.                            mips[0] = (void *)level_3_map;
  179.                            mips[1] = (void *)level_5_map;
  180.                            mips[2] = NULL;
  181.                          When calling W3D_AllocTexObj, you would give
  182.                          W3D_ATO_MIPMAP the value 0x6B (binary 1101011)
  183.                          W3D_ATO_MIPMAPPTRS would be mips.
  184.                    W3D_ATO_PALETTE (mandatory for chunky textures):
  185.                          Defines the palette which is necessary to handle
  186.                          chunky textures. A pointer to a palette must be
  187.                          provided. The palette itself is an array of
  188.                          ULONG's, and every ULONG defines the ARGB value
  189.                          for one color index. Therefore the palette must
  190.                          be 1024 bytes. (Note: On 8bit screens, this
  191.                          palette *should* be the screen palette,
  192.                          unless the driver returns TRUE on W3D_Q_PALETTECONV.)
  193.  
  194.    RESULT
  195.        Either a pointer to the successfully created texture
  196.        object, or NULL, in which case the optional error variable
  197.        is set to one of the following values:
  198.            W3D_SUCCESS             It worked!
  199.            W3D_ILLEGALINPUT        Some information was invalid, maybe
  200.                                      a mandatory tag missing
  201.            W3D_NOMEMORY            No memory was available
  202.            W3D_UNSOPPORTEDTEXSIZE  The driver can`t handle a texture
  203.                                      of the given size.
  204.            W3D_NOPALETTE           The texture should be a chunky (CLUT)
  205.                                      texture, but no palette was given.
  206.            W3D_UNSUPPORTEDTEXFMT   The format can not be used with the
  207.                                      current driver
  208.  
  209.    EXAMPLE
  210.        extern W3D_Context *context;
  211.        void *image = LoadImage("texture.iff");
  212.        W3D_Texture *texobj;
  213.        struct TagItem tags[] = {
  214.            W3D_ATO_IMAGE,      image,
  215.            W3D_ATO_FORMAT,     W3D_A1R5G5B5,
  216.            W3D_ATO_WITDH,      128,
  217.            W3D_ATO_HEIGHT,     128,
  218.            TAG_DONE,           0
  219.        };
  220.        ULONG error;
  221.  
  222.        texobj = W3D_AllocTexObj(context, &error, tags);
  223.        if (!texobj)
  224.            printf("An error has occurred because: An error has occurred (%d)\n",
  225.                        error);
  226.  
  227.  
  228.    NOTES
  229.        The pointers to textures and mipmaps passed to this function are
  230.        considered `locked` until this texture object is released again,
  231.        or the image is updated with W3D_UpdateTexImage.
  232.        You may not free the memory.
  233.  
  234.    BUGS
  235.  
  236.    SEE ALSO
  237.        W3D_FreeTexObj, W3D_ReleaseTexture, W3D_UpdateTexImage,
  238.        W3D_FlushTextures, W3D_SetFilter, W3D_SetTexEnv, W3D_SetWrapMode
  239.        W3D_UploadTexture
  240.  
  241. Warp3D/W3D_AllocZBuffer                                      Warp3D/W3D_AllocZBuffer
  242.  
  243.    NAME   
  244.        W3D_AllocZBuffer -- Allocate a ZBuffer
  245.  
  246.    SYNOPSIS
  247.        result = W3D_AllocZBuffer(context);
  248.        d0                        a0
  249.  
  250.        ULONG W3D_AllocZBuffer(W3D_Context *);
  251.  
  252.    FUNCTION
  253.        Allocates a ZBuffer. The size of the ZBuffer depends on the
  254.        size of the bitmap used with this context. The memory is allocated
  255.        on the graphics board.
  256.  
  257.    INPUTS
  258.        context - pointer to the context to be used with the ZBuffer
  259.  
  260.    RESULT
  261.        One of the following values:
  262.            W3D_SUCCESS     The allocation was successful
  263.            W3D_NOGFXMEM    Not enough video memory
  264.            W3D_NOZBUFFER   ZBuffering is not available on this hardware
  265.            W3D_NOTVISIBLE  - The bitmap is not visible/swapped out of vmem
  266.  
  267.    EXAMPLE
  268.        ULONG error, status;
  269.        struct BitMap myBitMap;
  270.        struct TagItem taglist[] = {
  271.            W3D_CC_BITMAP,      (ULONG)&myBitMap,
  272.            W3D_CC_YOFFSET,     0,
  273.            W3D_CC_DRIVERTYPE,  W3D_DRIVER_BEST
  274.        };
  275.        W3D_Context *context;
  276.  
  277.        InitBitMap(&myBitMap, 15, 640, 480);
  278.        createPlanes(&myBitMap);
  279.        context = W3D_CreateContext(&error, taglist);
  280.        status = W3D_AllocZBuffer(context);
  281.  
  282.    NOTES
  283.        This function should be called before textures are uploaded to
  284.        the graphics board, to avoid fragmentation of video memory.
  285.  
  286.    BUGS
  287.  
  288.    SEE ALSO
  289.        W3D_FreeZBuffer
  290.  
  291. Warp3D/W3D_CheckDriver                                        Warp3D/W3D_CheckDriver
  292.  
  293.    NAME   
  294.        W3D_CheckDriver -- Check driver availability
  295.  
  296.    SYNOPSIS
  297.        flags = W3D_CheckDriver();
  298.        d0
  299.  
  300.        ULONG W3D_CheckDriver(void);
  301.  
  302.    FUNCTION
  303.        Checks what driver is available (CPU/HW), and returns it
  304.        as a bit mask.
  305.  
  306.    INPUTS
  307.        None
  308.  
  309.    RESULT
  310.        A long word that has it`s bit set accordingly:
  311.            W3D_DRIVER_3DHW - A hardware driver is available
  312.            W3D_DRIVER_CPU  - A software driver is available
  313.  
  314.    EXAMPLE
  315.        ULONG flags = W3D_CheckDriver();
  316.        if (flags & W3D_DRIVER_3DHW) printf("Hardware driver available\n");
  317.        if (flags & W3D_DRIVER_CPU)  printf("Software driver available\n");
  318.  
  319.    NOTES
  320.        This function can be called without a valid context. It can
  321.        be used to evaluate the possibilities the system is offering.
  322.        Note though, that you should give the user a chance to get into
  323.        your program, even if you think it would be too slow without
  324.        hardware acceleration...
  325.  
  326.    BUGS
  327.  
  328.    SEE ALSO
  329.  
  330. Warp3D/W3D_CheckIdle                                            Warp3D/W3D_CheckIdle
  331.  
  332.    NAME   
  333.        W3D_CheckIdle -- check if hardware is working
  334.  
  335.    SYNOPSIS
  336.        working = W3D_CheckIdle(context);
  337.        d0                      a0
  338.  
  339.        ULONG W3D_CheckIdle(W3D_Context *);
  340.  
  341.    FUNCTION
  342.        Check if the hardware is finished with it`s current operation.
  343.  
  344.    INPUTS
  345.        context - a pointer to a W3D_Context
  346.  
  347.    RESULT
  348.        One of to values indicating busy/idle state:
  349.            W3D_SUCCESS - The hardware is idle
  350.            W3D_BUSY    - The hardware is still working
  351.  
  352.    EXAMPLE
  353.  
  354.    NOTES
  355.        This function is not very useful for applications.
  356.  
  357.    BUGS
  358.  
  359.    SEE ALSO
  360.        W3D_WaitIdle
  361.  
  362. Warp3D/W3D_ClearStencilBuffer                          Warp3D/W3D_ClearStencilBuffer
  363.  
  364.    NAME   
  365.        W3D_ClearStencilBuffer -- Clear the stencil buffer
  366.  
  367.    SYNOPSIS
  368.        success = W3D_ClearStencilBuffer(context, clearval);
  369.        d0                               a0       a1
  370.  
  371.        ULONG W3D_ClearStencilBuffer(W3D_Context *, ULONG *);
  372.  
  373.    FUNCTION
  374.        Clear the stencil buffer (fill it up) with the value
  375.        pointed to by clearval.
  376.        This function may only be used while the hardware is locked,
  377.        except when indirect drawing is used.
  378.  
  379.    INPUTS
  380.        context  - the context to work on
  381.        clearval - pointer to a value used for clearing
  382.  
  383.    RESULT
  384.        One of the following:
  385.            W3D_SUCCESS         Operation was successful
  386.            W3D_NOSTENCILBUFFER Stencil buffer not present (not allocated,
  387.                                    or not supported by driver)
  388.            W3D_NOTVISIBLE      The stencil buffer can not be accessed by
  389.                                    the hardware
  390.            W3D_QUEUEFAILED     In indirect mode only. Queueing this request
  391.                                    failed
  392.  
  393.    EXAMPLE
  394.  
  395.    NOTES
  396.  
  397.    BUGS
  398.  
  399.    SEE ALSO
  400.        W3D_AllocStencilBuffer, W3D_FreeStencilBuffer
  401.  
  402. Warp3D/W3D_ClearZBuffer                                      Warp3D/W3D_ClearZBuffer
  403.  
  404.    NAME   
  405.        W3D_ClearZBuffer -- Clear the ZBuffer with a given value
  406.  
  407.    SYNOPSIS
  408.        success = W3D_ClearZBuffer(context, clearvalue);
  409.        d0                         a0       a1
  410.  
  411.        ULONG W3D_ClearZBuffer(W3D_Context *, W3D_Double *);
  412.  
  413.    FUNCTION
  414.        Clear the ZBuffer with a given value.
  415.        This function may only be used while the hardware is locked,
  416.        except when indirect drawing is used.
  417.  
  418.    INPUTS
  419.        context     - pointer to the context
  420.        clearvalue  - pointer to a W3D_Double, ranging from [0..1].
  421.                      If NULL, 0.0 is used
  422.  
  423.    RESULT
  424.        One of the following values:
  425.            W3D_SUCCESS     operation successful
  426.            W3D_NOZBUFFER   No ZBuffer was allocated
  427.            W3D_NOTVISIBLE  The ZBuffer was not in video ram
  428.            W3D_QUEUEFAILED     In indirect mode only. Queueing this request
  429.                                    failed
  430.  
  431.    EXAMPLE
  432.  
  433.    NOTES
  434.  
  435.    BUGS
  436.  
  437.    SEE ALSO
  438.        W3D_AllocZBuffer, W3D_FreeZBuffer
  439.  
  440. Warp3D/W3D_CreateContext                                    Warp3D/W3D_CreateContext
  441.  
  442.    NAME   
  443.        W3D_CreateContext -- Create a new Warp3D context
  444.  
  445.    SYNOPSIS
  446.        context = W3D_CreateContext(&error, CCTags);
  447.        D0                          A0      A1
  448.  
  449.        W3D_Context *W3D_CreateContext(ULONG *, struct TagItem *);
  450.  
  451.    FUNCTION
  452.        This function creates a new Warp3D context, which is required by most
  453.        other API functions as first parameter.
  454.  
  455.        The number of open contexts is not limited. Full multitasking capabilities
  456.        are provided.
  457.  
  458.    INPUTS
  459.        error   - A pointer to a ULONG which gets the error value,
  460.                    or NULL if you don`t want an error code returned
  461.        CCTags  - A taglist containing various input parameters:
  462.            W3D_CC_MODEID (special):
  463.                  Specifies the ModeID of the screen you opened or
  464.                  intend to open, or generally the ModeID of the drawing
  465.                  area you intend to use. If you plan to use Warp3D in
  466.                  windowed mode, you may leave this tag unset. Otherwise,
  467.                  the tag MUST be set correctly, as the ModeID is used to
  468.                  extract the required hardware.
  469.            W3D_CC_BITMAP (mandatory):
  470.                  A pointer to the bitmap which is used for 3D drawing.
  471.                  For 3DHW drivers, the bitmap must absolutely be located
  472.                  in video memory (it may be swapped out at the moment).
  473.                  For CPU drivers, it doesn't matter, where the bitmap is
  474.                  located. Note, that CPU drivers might use FAST-RAM
  475.                  buffers for intermediate results to speed up rendering,
  476.                  therefore bitmaps in FAST-RAM might not be optimal in
  477.                  this case.
  478.                  Also note, that never bitmaps should be provided which
  479.                  are directly visible!
  480.            W3D_CC_YOFFSET (mandatory):
  481.                  A vertical offset, which defines, at which Y-Position
  482.                  the drawing area starts. This can be used to achieve
  483.                  multibuffering using the ScrollVPort trick, which might
  484.                  be the only possibility to achieve proper multibuffering
  485.                  with some graphics interface software.
  486.            W3D_CC_DRIVERTYPE (mandatory):
  487.                  A constant which defines what type of driver should
  488.                  be used (use the API function W3D_CheckDriver to get
  489.                  more information about the drivers). Possible values
  490.                  are:
  491.                  - W3D_DRIVER_BEST       the best driver is chosen
  492.                  - W3D_DRIVER_3DHW       the hardware driver is chosen,
  493.                                             if none is present, NULL is
  494.                                             returned
  495.                  - W3D_DRIVER_CPU        the software driver is chosen,
  496.                                             if none is present, NULL is
  497.                                             returned
  498.            W3D_CC_W3DBM (optional):
  499.                  Boolean tag. If this is set to TRUE, the W3D_CC_BITMAP
  500.                  tag doesn't point to a struct BitMap. Instead, it points
  501.                  to a Warp3D bitmap (of type W3D_Bitmap), which might
  502.                  be in fast-ram (for CPU rendering). Note that the
  503.                  W3D_CC_YOFFSET tag is ignored if W3D_CC_W3DBM is set
  504.                  to TRUE.
  505.            W3D_CC_INDIRECT (optional):
  506.                  Boolean tag. If set to TRUE, then all drawing actions are
  507.                  possibly not performed directly, but are queued until
  508.                  the buffer is full, or W3D_Flush is called, or the
  509.                  indirect state is switched off with W3D_SetState
  510.            W3D_CC_GLOBALTEXENV (optional):
  511.                  Boolean tag. If set to TRUE, calls to SetTexEnv do not
  512.                  modify the given texture, but are used for all textures.
  513.            W3D_CC_DOUBLEHEIGHT (optional):
  514.                  Boolean tag. This tag should be set to TRUE if the drawing
  515.                  area is a double height screen. Double height screens
  516.                  may be used for double buffering with CyberGraphX.
  517.            W3D_CC_FAST: (optional):
  518.                  Boolean tag. If set to TRUE, drawing functions are allowed
  519.                  to modify the passed structures.
  520.  
  521.  
  522.    RESULT
  523.        A pointer to a newly created context structure, or NULL for failure.
  524.        If an error variable was provided, the error value is filled in.
  525.        It may be one of the following values:
  526.            W3D_SUCCESS         - Operation was successful
  527.            W3D_ILLEGALINPUT    - Illegal input, maybe a left out tag item
  528.            W3D_NOMEMORY        - Unable to get enough memory
  529.            W3D_NODRIVER        - No driver was available
  530.            W3D_UNSUPPORTEDFMT  - The supplied bitmap can`t be supported
  531.            W3D_ILLEGALBITMAP   - The bitmap is not properly initialised
  532.  
  533.    EXAMPLE
  534.        ULONG error;
  535.        struct BitMap myBitMap;
  536.        struct TagItem taglist[] = {
  537.            W3D_CC_BITMAP,      (ULONG)&myBitMap,
  538.            W3D_CC_YOFFSET,     0,
  539.            W3D_CC_DRIVERTYPE,  W3D_DRIVER_BEST
  540.        };
  541.        W3D_Context *context;
  542.  
  543.        InitBitMap(&myBitMap, 15, 640, 480);
  544.        createPlanes(&myBitMap);
  545.        context = W3D_CreateContext(&error, taglist);
  546.  
  547.    NOTES
  548.        An error of type W3D_UNSUPPORTEDFMT is returned if a W3D_Bitmap
  549.        is given as drawregion and no CPU driver is available, or
  550.        a HW driver is also requested.
  551.  
  552.    BUGS
  553.  
  554.    SEE ALSO
  555.        W3D_DestroyContext, W3D_Flush, W3D_SetState
  556.  
  557. Warp3D/W3D_DestroyContext                                  Warp3D/W3D_DestroyContext
  558.  
  559.    NAME   
  560.        W3D_DestoryContext -- Release a Warp3D context
  561.  
  562.    SYNOPSIS
  563.        W3D_DestoryContext(context);
  564.                           A0
  565.  
  566.        void W3D_DestroyContext(W3D_Context *);
  567.  
  568.    FUNCTION
  569.        This function frees up all resources for the given context,
  570.        destroying it.
  571.  
  572.    INPUTS
  573.        context - Pointer to a Warp3D context
  574.  
  575.    RESULT
  576.        None
  577.  
  578.    EXAMPLE
  579.        W3D_Context *context;
  580.        ...
  581.        context = W3D_CreateContext(.....);
  582.        ...
  583.        W3D_DestroyContext(context);
  584.  
  585.    NOTES
  586.        Always release contexts. Even if the memory loss doesn't kill you,
  587.        the hardware may be blocked.
  588.  
  589.    BUGS
  590.  
  591.    SEE ALSO
  592.        W3D_CreateContext
  593.  
  594. Warp3D/W3D_DrawLine                                              Warp3D/W3D_DrawLine
  595.  
  596.    NAME   
  597.        W3D_DrawLine -- Draw a three-dimensional line
  598.  
  599.    SYNOPSIS
  600.        success = W3D_DrawLine(context, line);
  601.        d0                     a0       a1
  602.  
  603.        ULONG W3D_DrawLine(W3D_Context *, W3D_Line *);
  604.  
  605.    FUNCTION
  606.        This function draws a line based on the current state.
  607.        It may only be used while the hardware is locked, except when
  608.        indirect drawing is used.
  609.  
  610.    INPUTS
  611.        context - The context to be drawn in
  612.        line    - Definition of a line.
  613.  
  614.    RESULT
  615.        A value inidcating success or failure. One of the following:
  616.            W3D_SUCCESS         (you guessed it!)
  617.            W3D_NOTEXTURE       The line has no texture
  618.            W3D_TEXNOTRESIDENT  The required texture is not in video ram
  619.            W3D_NOGFXMEM        No memory available on the graphics card
  620.            W3D_NOTVISIBLE      The drawing area is not visible
  621.            W3D_NOZBUFFER       No ZBuffer
  622.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  623.  
  624.    EXAMPLE
  625.  
  626.    NOTES
  627.        The linewidth parameter will probably not be supported
  628.        by most 3D hardware.
  629.  
  630.    BUGS
  631.  
  632.    SEE ALSO
  633.  
  634. Warp3D/W3D_DrawLineLoop                                      Warp3D/W3D_DrawLineLoop
  635.  
  636.    NAME
  637.        W3D_DrawLineLoop -- Draw a closed sequence of connected lines (V2)
  638.  
  639.    SYNOPSIS
  640.        success = W3D_DrawLineLoop(context, lines);
  641.        d0                          a0       a1
  642.  
  643.        ULONG W3D_DrawLineLoop(W3D_Context *, W3D_Lines *);
  644.  
  645.    FUNCTION
  646.        This function draws a connected sequence of lines, similar to
  647.        the W3D_DrawLineStrip function. The only difference is that the
  648.        last vertex is connected to the first with a line segment, too,
  649.        meaning that the vertexcount lines are drawn.
  650.  
  651.    INPUTS
  652.        context     - pointer to the context.
  653.        lines       - pointer to the W3D_Lines (not the trailing 's')
  654.                      structure defining the line strip.
  655.  
  656.    RESULT
  657.        One of the following:
  658.            W3D_SUCCESS         It worked.
  659.            W3D_NOTEXTURE       No texture given
  660.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  661.            W3D_NOTVISIBLE      The drawing area is not visible
  662.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  663.            W3D_ILLEGALINPUT    Fewer than two vertices were given
  664.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  665.  
  666.    EXAMPLE
  667.  
  668.    NOTES
  669.  
  670.    BUGS
  671.        Currently, this call is not queued.
  672.  
  673.    SEE ALSO
  674.        W3D_DrawLineLoop, W3D_DrawLine
  675.  
  676. Warp3D/W3D_DrawLineStrip                                    Warp3D/W3D_DrawLineStrip
  677.  
  678.    NAME
  679.        W3D_DrawLineStrip -- Draw a sequence of connected lines (V2)
  680.  
  681.    SYNOPSIS
  682.        success = W3D_DrawLineStrip(context, lines);
  683.        d0                          a0       a1
  684.  
  685.        ULONG W3D_DrawLineStrip(W3D_Context *, W3D_Lines *);
  686.  
  687.    FUNCTION
  688.        Draws a sequence of connected lines (a line strip). The first
  689.        line is defined by vertices 0 and 1, the second line by vertices
  690.        1 and 2, ..., up to the last line being defined by vertices
  691.        n-1 and n, with n being the vertexcount field from the W3D_Lines
  692.        structure.
  693.  
  694.    INPUTS
  695.        context     - pointer to the context.
  696.        lines       - pointer to the W3D_Lines (not the trailing 's')
  697.                      structure defining the line strip.
  698.  
  699.    RESULT
  700.        One of the following:
  701.            W3D_SUCCESS         It worked.
  702.            W3D_NOTEXTURE       No texture given
  703.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  704.            W3D_NOTVISIBLE      The drawing area is not visible
  705.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  706.            W3D_ILLEGALINPUT    Fewer than two vertices were given
  707.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  708.  
  709.    EXAMPLE
  710.  
  711.    NOTES
  712.  
  713.    BUGS
  714.        Currently, this call is not queued.
  715.  
  716.    SEE ALSO
  717.        W3D_DrawLineLoop, W3D_DrawLine
  718.  
  719. Warp3D/W3D_DrawPoint                                            Warp3D/W3D_DrawPoint
  720.  
  721.    NAME   
  722.        W3D_DrawPoint -- Draw a point
  723.  
  724.    SYNOPSIS
  725.        success = W3D_DrawPoint(context, point);
  726.        d0                      a0       a1
  727.  
  728.        ULONG W3D_DrawPoint(W3D_Context *, W3D_Point *);
  729.  
  730.    FUNCTION
  731.        Draw a point based on the current context
  732.        It may only be used while the hardware is locked, except when
  733.        indirect drawing is used.
  734.  
  735.    INPUTS
  736.        context - a pointer to the context to draw with
  737.        point   - a pointer to a filled W3D_Point
  738.  
  739.    RESULT
  740.        One of the following:
  741.            W3D_SUCCESS         It worked.
  742.            W3D_NOTEXTURE       No texture given
  743.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  744.            W3D_NOTVISIBLE      The drawing area is not visible
  745.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  746.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  747.  
  748.    EXAMPLE
  749.  
  750.    NOTES
  751.        The pointsize parameter will probably not be supported by most
  752.        3D hardware.
  753.  
  754.        Although the vertex has it's own color, the GOURAUD shading state
  755.        must be enabled to use this color, otherwise the current color set
  756.        by W3D_SetCurrentColor/W3D_SetCurrentPen will be used.
  757.  
  758.    BUGS
  759.  
  760.    SEE ALSO
  761.  
  762. Warp3D/W3D_DrawTriangle                                      Warp3D/W3D_DrawTriangle
  763.  
  764.    NAME   
  765.        W3D_DrawTriangle -- Draw a triangle
  766.  
  767.    SYNOPSIS
  768.        success = W3D_DrawTriangle(context, triangle);
  769.        d0                         a0       a1
  770.  
  771.        ULONG W3D_DrawTriangle(W3D_Context *, W3D_Triangle *);
  772.  
  773.    FUNCTION
  774.        Draw a triangle to the given context, based on that context`s
  775.        state.
  776.        It may only be used while the hardware is locked, except when
  777.        indirect drawing is used.
  778.  
  779.    INPUTS
  780.        context     - the context to be drawn to
  781.        triangle    - the triangle to be drawn
  782.  
  783.    RESULT
  784.        One of the following:
  785.            W3D_SUCCESS         It worked.
  786.            W3D_NOTEXTURE       No texture given
  787.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  788.            W3D_NOTVISIBLE      The drawing area is not visible
  789.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  790.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  791.  
  792.    EXAMPLE
  793.  
  794.    NOTES
  795.  
  796.    BUGS
  797.  
  798.    SEE ALSO
  799.        W3D_DrawTriFan, W3D_DrawTriStrip
  800.  
  801. Warp3D/W3D_DrawTriFan                                          Warp3D/W3D_DrawTriFan
  802.  
  803.    NAME   
  804.        W3D_DrawTriFan -- Draw a triangle fan
  805.  
  806.    SYNOPSIS
  807.        success = W3D_DrawTriFan(context, triangles);
  808.        d0                       a0       a1
  809.  
  810.        ULONG W3D_DrawTriFan(W3D_Context *, W3D_Triangles *);
  811.  
  812.    FUNCTION
  813.        Draw a triangle fan. The first vertex in the list is
  814.        considered the common point for the fan. For more
  815.        information on triangle fans, see the OpenGL specs.
  816.        This function may only be used while the hardware is locked,
  817.        except when indirect drawing is used.
  818.  
  819.    INPUTS
  820.        context     - pointer to the context.
  821.        triangles   - pointer to a vertex list. Note that this
  822.                      is a W3D_Triangles (trailing s, avoid mixing
  823.                      up with W3D_Traingle)
  824.  
  825.    RESULT
  826.        One of the following:
  827.            W3D_SUCCESS         It worked.
  828.            W3D_NOTEXTURE       No texture given
  829.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  830.            W3D_NOTVISIBLE      The drawing area is not visible
  831.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  832.            W3D_ILLEGALINPUT    Less than three vertices were given
  833.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  834.  
  835.    EXAMPLE
  836.  
  837.    NOTES
  838.  
  839.    BUGS
  840.  
  841.    SEE ALSO
  842.        W3D_DrawTriangle, W3D_DrawTriStrip
  843.  
  844. Warp3D/W3D_DrawTriStrip                                      Warp3D/W3D_DrawTriStrip
  845.  
  846.    NAME
  847.        W3D_DrawTriStrip -- Draw a triangle strip
  848.  
  849.    SYNOPSIS
  850.        success = W3D_DrawTriStrip(context, triangles);
  851.        d0                       a0       a1
  852.  
  853.        ULONG W3D_DrawTriStrip(W3D_Context *, W3D_Triangles *);
  854.  
  855.    FUNCTION
  856.        Draw a triangle strip. For more information
  857.        on triangle strips, see the OpenGL specs.
  858.        This function may only be used while the hardware is locked,
  859.        except when indirect drawing is used.
  860.  
  861.    INPUTS
  862.        context     - pointer to the context.
  863.        triangles   - pointer to a vertex list. Note that this
  864.                      is a W3D_Triangles (trailing s, avoid mixing
  865.                      up with W3D_Traingle)
  866.  
  867.    RESULT
  868.        One of the following:
  869.            W3D_SUCCESS         It worked.
  870.            W3D_NOTEXTURE       No texture given
  871.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  872.            W3D_NOTVISIBLE      The drawing area is not visible
  873.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  874.            W3D_ILLEGALINPUT    Less than three vertices were given
  875.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  876.  
  877.    EXAMPLE
  878.  
  879.    NOTES
  880.  
  881.    BUGS
  882.  
  883.    SEE ALSO
  884.        W3D_DrawTriangle, W3D_DrawTriFan
  885.  
  886. Warp3D/W3D_FillStencilBuffer                            Warp3D/W3D_FillStencilBuffer
  887.  
  888.    NAME   
  889.        W3D_FillStencilBuffer -- Fill the stencil buffer
  890.  
  891.    SYNOPSIS
  892.        success = W3D_FillStencilBuffer(context, x, y, width, height, depth, data);
  893.        d0                              a0       d0 d1 d2     d3      d4     a1
  894.  
  895.        ULONG W3D_FillStencilBuffer(W3D_Context *, ULONG, ULONG, ULONG, ULONG,
  896.                            ULONG, void *);
  897.  
  898.    FUNCTION
  899.        This function fills the stencil buffer with a rectangular image
  900.        with the given dimensions.
  901.        This function may only be used while the hardware is locked,
  902.        except when indirect drawing is used.
  903.  
  904.    INPUTS
  905.        context - the context
  906.        x,y     - Coordinates into the stencil buffer
  907.        width   - Width of the image data
  908.        height  - Height of the image data
  909.        depth   - Depth of the image data. Must be 8,16 or 32
  910.        data    - The data itself
  911.  
  912.    RESULT
  913.        One of the following values:
  914.            W3D_SUCCESS             Operation successful
  915.            W3D_NOSTENCILBUFFER     No stencil buffer present (either it`s not
  916.                                        allocated, or not supported)
  917.            W3D_ILLEGALINPUT        Illegal depth value
  918.            W3D_NOTVISIBLE          The stencil buffer can not be accessed by
  919.                                        the hardware
  920.  
  921.    EXAMPLE
  922.  
  923.    NOTES
  924.  
  925.    BUGS
  926.  
  927.    SEE ALSO
  928.        W3D_CreateStencilBuffer, W3D_ClearStencilBuffer
  929.  
  930. Warp3D/W3D_Flush                                                    Warp3D/W3D_Flush
  931.  
  932.    NAME   
  933.        W3D_Flush -- Flush indirect drawing queue
  934.  
  935.    SYNOPSIS
  936.        result = W3D_Flush(context);
  937.                  a0
  938.  
  939.        ULONG W3D_Flush(W3D_Context *);
  940.  
  941.    FUNCTION
  942.        If the given context is not in indirect mode, nothing happens.
  943.        Otherwise, the internal queue is flushed and all buffered drawing
  944.        request are drawn.
  945.  
  946.    INPUTS
  947.        context - the context which should be flushed
  948.  
  949.    RESULT
  950.        A value indicating error or success:
  951.            W3D_SUCCESS     success
  952.            W3D_NOTVISIBLE  Locking the hardware was unsuccesful
  953.  
  954.    EXAMPLE
  955.  
  956.    NOTES
  957.  
  958.    BUGS
  959.  
  960.    SEE ALSO
  961.        W3D_SetState, W3D_CreateContext, W3D_LockHardware, W3D_UnLockHardware
  962.  
  963. Warp3D/W3D_FlushFrame                                          Warp3D/W3D_FlushFrame
  964.  
  965.    NAME
  966.        W3D_FlushFrame -- Flush the current frame
  967.  
  968.    SYNOPSIS
  969.        W3D_FlushFrame(context);
  970.                          a0
  971.  
  972.        void W3D_FlushFrame(W3D_Context*);
  973.  
  974.    FUNCTION
  975.        This function flushes the current frame. It must be called at the end
  976.        of your drawing when the frame is finished. This function *must* be
  977.        called by any application, even if you do not "intent" to support
  978.        CPU drivers (for which this function is mainly designed).
  979.  
  980.    INPUTS
  981.        context -   The context to flush
  982.  
  983.    RESULT
  984.  
  985.    EXAMPLE
  986.  
  987.    NOTES
  988.        If the context is indirect, this function also flushes the
  989.        Queue.
  990.  
  991.    BUGS
  992.  
  993.    SEE ALSO
  994.  
  995. Warp3D/W3D_FlushTextures                                    Warp3D/W3D_FlushTextures
  996.  
  997.    NAME   
  998.        W3D_FlushTextures -- Release all textures from video ram
  999.  
  1000.    SYNOPSIS
  1001.        W3D_FlushTextures(context);
  1002.                          a0
  1003.  
  1004.        void W3D_FlushTextures(W3D_Context);
  1005.  
  1006.    FUNCTION
  1007.        This function releases every texture that`s currently
  1008.        on the graphics board`s texture memory.
  1009.  
  1010.    INPUTS
  1011.        context - Pointer to a W3D_Context
  1012.  
  1013.    RESULT
  1014.        None
  1015.  
  1016.    EXAMPLE
  1017.  
  1018.    NOTES
  1019.  
  1020.    BUGS
  1021.  
  1022.    SEE ALSO
  1023.        W3D_ReleaseTexture
  1024.  
  1025. Warp3D/W3D_FreeAllTexObj                                    Warp3D/W3D_FreeAllTexObj
  1026.  
  1027.    NAME   
  1028.        W3D_FreeAllTexObj -- Free all textures in context
  1029.  
  1030.    SYNOPSIS
  1031.        W3D_FreeAllTexObj(context);
  1032.                          a0
  1033.  
  1034.        void W3D_FreeTexObj(W3D_Context *);
  1035.  
  1036.    FUNCTION
  1037.        Free all texture objects allocated in the current context.
  1038.  
  1039.    INPUTS
  1040.        context - the pointer to the context
  1041.  
  1042.    RESULT
  1043.  
  1044.    EXAMPLE
  1045.  
  1046.    NOTES
  1047.  
  1048.    BUGS
  1049.  
  1050.    SEE ALSO
  1051.        W3D_FreeTexObj, W3D_AllocTexObj
  1052.  
  1053. Warp3D/W3D_FreeStencilBuffer                            Warp3D/W3D_FreeStencilBuffer
  1054.  
  1055.    NAME   
  1056.        W3D_FreeStencilBuffer -- Free the stencil buffer
  1057.  
  1058.    SYNOPSIS
  1059.        success = W3D_FreeStencilBuffer(context);
  1060.        d0                              a0
  1061.  
  1062.        ULONG W3D_FreeStencilBuffer(W3D_Context *);
  1063.  
  1064.    FUNCTION
  1065.        Free up all memory associated with the stencil buffer.
  1066.  
  1067.    INPUTS
  1068.        context - the context containing the stencil buffer to be freed
  1069.  
  1070.    RESULT
  1071.        One of the following values:
  1072.            W3D_SUCCESS             Operation succesful
  1073.            W3D_NOSTENCILBUFFER     No stencil buffer was allocated, or stencil
  1074.                                        buffering is not supported by the current
  1075.                                        hardware driver.
  1076.            W3D_NOTVISIBLE          The stencil buffer can not be accessed by
  1077.                                        the hardware
  1078.  
  1079.    EXAMPLE
  1080.  
  1081.    NOTES
  1082.  
  1083.    BUGS
  1084.  
  1085.    SEE ALSO
  1086.        W3D_CreateStencilBuffer
  1087.  
  1088. Warp3D/W3D_FreeTexObj                                          Warp3D/W3D_FreeTexObj
  1089.  
  1090.    NAME   
  1091.        W3D_FreeTexObj -- Free a texture object
  1092.  
  1093.    SYNOPSIS
  1094.        W3D_FreeTexObj(context, texture);
  1095.                       a0       a1
  1096.  
  1097.        void W3D_FreeTexObj(W3D_Context *, W3D_Texture *);
  1098.  
  1099.    FUNCTION
  1100.        Remove the texture object from the list of textures
  1101.        and free up all resources associated with it.
  1102.  
  1103.    INPUTS
  1104.        context - Pointer to a W3D_Context
  1105.        texture - Pointer to a texture to be released
  1106.  
  1107.    RESULT
  1108.        None
  1109.  
  1110.    EXAMPLE
  1111.        extern W3D_Context *context;
  1112.        void *image = LoadImage("texture.iff");
  1113.        W3D_Texture *texobj;
  1114.        struct TagItem tags[] = {
  1115.            W3D_ATO_IMAGE,      image,
  1116.            W3D_ATO_FORMAT,     W3D_A1R5G5B5,
  1117.            W3D_ATO_WITDH,      128,
  1118.            W3D_ATO_HEIGHT,     128,
  1119.            TAG_DONE,           0
  1120.        };
  1121.        ULONG error;
  1122.  
  1123.        texobj = W3D_AllocTexObj(context, &error, tags);
  1124.        if (!texobj) {
  1125.            printf("An error has occurred because: An error has occurred (%d)\n",
  1126.                        error);
  1127.        } else {
  1128.            ... Draw some cool stuff ...
  1129.            W3D_FreeTexObj(context, texobj);
  1130.  
  1131.  
  1132.    NOTES
  1133.        Free all textures. Even if you can afford the memory loss in main memory,
  1134.        you`ll loose video memory.
  1135.        The `locked` pointers (those to the image and user-defined mipmaps)
  1136.        are now `unlocked`, and may be used again.
  1137.  
  1138.    BUGS
  1139.  
  1140.    SEE ALSO
  1141.        W3D_AllocTexObj
  1142.  
  1143. Warp3D/W3D_FreeZBuffer                                        Warp3D/W3D_FreeZBuffer
  1144.  
  1145.    NAME   
  1146.        W3D_FreeZBuffer -- Free ZBuffer
  1147.  
  1148.    SYNOPSIS
  1149.        success = W3D_FreeZBuffer(context);
  1150.        d0                        a0
  1151.  
  1152.        ULONG W3D_FreeZBuffer(W3D_Context *);
  1153.  
  1154.    FUNCTION
  1155.        Free the ZBuffer previously allocated with W3D_AllocZBuffer
  1156.  
  1157.    INPUTS
  1158.        context - Pointer to a W3D_Context
  1159.  
  1160.    RESULT
  1161.        One of the following values:
  1162.            W3D_SUCCESS     Success
  1163.            W3D_NOZBUFFER   No Z Buffer was allocated
  1164.            W3D_NOTVISIBLE  ZBuffer is not visible
  1165.  
  1166.    EXAMPLE
  1167.  
  1168.    NOTES
  1169.  
  1170.    BUGS
  1171.  
  1172.    SEE ALSO
  1173.        W3D_AllocZBuffer
  1174.  
  1175. Warp3D/W3D_GetDestFmt                                          Warp3D/W3D_GetDestFmt
  1176.  
  1177.    NAME   
  1178.        W3D_GetDestFmt -- Get information about supported formats
  1179.  
  1180.    SYNOPSIS
  1181.        format = W3D_GetDestFmt();
  1182.        d0
  1183.  
  1184.        ULONG W3D_GetDestFmt(void);
  1185.  
  1186.    FUNCTION
  1187.        *DEPRECATED* DO NOT USE THIS IN NEW PROJECTS
  1188.        This function can be used to get information about the destination
  1189.        (i.e. screen) format supported by the current driver. The result
  1190.        is a bitmask, with each bit representing a supported format.
  1191.        This function can be used before opening a display, to ensure
  1192.        that only a supported display area is selected.
  1193.  
  1194.    INPUTS
  1195.        None
  1196.  
  1197.    RESULT
  1198.        A bitmask representing supported modes. Currently, some of the
  1199.        following bits:
  1200.            W3D_FMT_CLUT
  1201.            W3D_FMT_R5G5B5
  1202.            W3D_FMT_B5G5R5
  1203.            W3D_FMT_R5G5B5PC
  1204.            W3D_FMT_B5G5R5PC
  1205.            W3D_FMT_R5G6B5
  1206.            W3D_FMT_B5G6R5
  1207.            W3D_FMT_R5G6B5PC
  1208.            W3D_FMT_B5G6R5PC
  1209.            W3D_FMT_R8G8B8
  1210.            W3D_FMT_B8G8R8
  1211.            W3D_FMT_A8R8G8B8
  1212.            W3D_FMT_A8B8G8R8
  1213.            W3D_FMT_R8G8B8A8
  1214.            W3D_FMT_B8G8R8A8
  1215.  
  1216.    EXAMPLE
  1217.        ULONG fmt = W3D_GetDestFmt();
  1218.  
  1219.        if (fmt & W3D_FMT_CLUT)     printf("Driver supports 8 bit modes\n");
  1220.        if (fmt & W3D_R5G5B5)       printf("Driver supports 15 bit RGB modes\n");
  1221.  
  1222.    NOTES
  1223.        This function is deprecated and should not be used in future
  1224.        projects.
  1225.  
  1226.    BUGS
  1227.  
  1228.    SEE ALSO
  1229.        W3D_CreateContext, W3D_Query, W3D_GetDrivers
  1230.  
  1231. Warp3D/W3D_GetDrivers                                          Warp3D/W3D_GetDrivers
  1232.  
  1233.    NAME
  1234.        W3D_GetDrivers -- Get the internal list of drivers (V2)
  1235.  
  1236.    SYNOPSIS
  1237.        driverarray = W3D_GetDrivers();
  1238.           D0
  1239.  
  1240.        W3D_Driver **W3D_GetDrivers(void);
  1241.  
  1242.    FUNCTION
  1243.        This function returns a (NULL-Terminated) Array of pointers
  1244.        to W3D_Driver structures. You can use these to find a suitable
  1245.        driver, offer the user a selection of hardware, or activate
  1246.        one driver for further queries.
  1247.  
  1248.    INPUTS
  1249.  
  1250.    RESULT
  1251.        driverarray -   A null-terminated array of pointers to
  1252.                        W3D_Driver structures.
  1253.  
  1254.    EXAMPLE
  1255.  
  1256.    NOTES
  1257.        The returned list is STRICTLY read-only.
  1258.  
  1259.    BUGS
  1260.  
  1261.    SEE ALSO
  1262.        W3D_TestMode
  1263.  
  1264. Warp3D/W3D_GetDriverState                                  Warp3D/W3D_GetDriverState
  1265.  
  1266.    NAME   
  1267.        W3D_GetDriverState -- get current state of driver
  1268.  
  1269.    SYNOPSIS
  1270.        result = W3D_GetDriverState(context);
  1271.        d0                          a0
  1272.  
  1273.        ULONG W3D_GetDriverState(W3D_Context *);
  1274.  
  1275.    FUNCTION
  1276.        Return information about the current state of the driver.
  1277.        This function can be used to check if the current driver
  1278.        is able to start rendering now.
  1279.  
  1280.    INPUTS
  1281.        context - The context to check the state for
  1282.  
  1283.    RESULT
  1284.        One of the following values:
  1285.            W3D_SUCCESS         Success, rendering possible
  1286.            W3D_NOTVISIBLE      Drawing area is not currently on
  1287.                                the video card's memory.
  1288.  
  1289.    EXAMPLE
  1290.        if (W3D_SUCCESS == W3D_GetDriverState(context)
  1291.            RenderFrame();
  1292.        else
  1293.            printf("Error: Bitmap not visible, can't render\n");
  1294.  
  1295.    NOTES
  1296.  
  1297.    BUGS
  1298.  
  1299.    SEE ALSO
  1300.        W3D_LockHardware
  1301.  
  1302. Warp3D/W3D_GetDriverTexFmtInfo                        Warp3D/W3D_GetDriverTexFmtInfo
  1303.  
  1304.    NAME
  1305.        W3D_GetDriverTexFmtInfo -- Get information about the texture format (V2)
  1306.  
  1307.    SYNOPSIS
  1308.        info = W3D_GetDriverTexFmtInfo(driver, format, destfmt);
  1309.        d0                               a0       d0      d1
  1310.  
  1311.        ULONG W3D_GetDriverTexInfo(W3D_Driver*, ULONG, ULONG);
  1312.  
  1313.    FUNCTION
  1314.        This function is used to get information about the texture
  1315.        format, i.e. if it`s directly supported by the hardware,
  1316.        or must be converted in some way. Contrary to the similar
  1317.        function W3d_GetTexFmtInfo, this function does not need a
  1318.        context to operate, but can be used to query individual drivers
  1319.        about their texture format capabilities.
  1320.  
  1321.    INPUTS
  1322.        driver  - A pointer to a W3D_Driver structure
  1323.        texfmt  - The texture format to be queried. Currently,
  1324.                  one of the following:
  1325.                    W3D_CHUNKY           palettized
  1326.                    W3D_A1R5G5B5         a rrrrr ggggg bbbbb
  1327.                    W3D_R5G6B5           rrrrr gggggg bbbbb
  1328.                    W3D_R8G8B8           rrrrrrrr gggggggg bbbbbbbb
  1329.                    W3D_A4R4G4B4         aaaa rrrr gggg bbbb
  1330.                    W3D_A8R8G8B8         aaaaaaaa rrrrrrrr gggggggg bbbbbbbb
  1331.                    W3D_R8G8B8A8         rrrrrrrr gggggggg bbbbbbbb aaaaaaaa
  1332.                    W3D_A8               aaaaaaaa
  1333.                    W3D_L8               llllllll
  1334.                    W3D_L8A8             llllllll aaaaaaaa
  1335.                    W3D_I8               iiiiiiii
  1336.                  See the main documentation for more information.
  1337.        destfmt - The destination screen format.
  1338.  
  1339.    RESULT
  1340.        A bitvector with the following bits
  1341.            W3D_TEXFMT_FAST         Format directly supported by HW
  1342.            W3D_TEXFMT_CLUTFAST     Format directly supported in CLUT modes only
  1343.            W3D_TEXFMT_ARGBFAST     Format directly supported in direct color
  1344.                                        modes only
  1345.            W3D_TEXFMT_UNSUPPORTED  Format not supported, and can't be emulated
  1346.            W3D_TEXFMT_SUPPORTED    Format is supported, although it may be
  1347.                                        internally converted
  1348.  
  1349.    EXAMPLE
  1350.  
  1351.    NOTES
  1352.        Formats that are not directly supported can still be used for textures.
  1353.        Note, however, that those textures must be converted.
  1354.  
  1355.    BUGS
  1356.  
  1357.    SEE ALSO
  1358.        W3D_GetTexFmtInfo()
  1359.  
  1360. Warp3D/W3D_GetState                                              Warp3D/W3D_GetState
  1361.  
  1362.    NAME   
  1363.        W3D_GetState -- Get current state of hardware/context
  1364.  
  1365.    SYNOPSIS
  1366.        result = W3D_GetState(context, state);
  1367.        d0                    a0       d0
  1368.  
  1369.        ULONG W3D_GetState(W3D_Context *, ULONG);
  1370.  
  1371.    FUNCTION
  1372.        This function reads the state of the bits in the
  1373.        state field of the context structure.
  1374.  
  1375.    INPUTS
  1376.        context - pointer to a Warp3D context
  1377.        state   - The bit that is tested. Currently, this may
  1378.                  be one of the following:
  1379.                      W3D_AUTOTEXMANAGEMENT  automatic texture management
  1380.                      W3D_SYNCHRON           wait, until HW is idle
  1381.                      W3D_INDIRECT           buffer drawings until W3D_Flush()'ed
  1382.                      W3D_GLOBALTEXENV       global texture modes
  1383.                      W3D_DOUBLEHEIGHT       screen has double height.
  1384.                      W3D_FAST               Drawing functions may modify passed stru
  1385. ctures
  1386.                      W3D_TEXMAPPING         texmapping state
  1387.                      W3D_PERSPECTIVE        perspective correction state
  1388.                      W3D_GOURAUD            gouraud/flat shading
  1389.                      W3D_ZBUFFER            Z-Buffer state
  1390.                      W3D_ZBUFFERUPDATE      Z-Buffer update state
  1391.                      W3D_BLENDING           Alpha blending state
  1392.                      W3D_FOGGING            Fogging state
  1393.                      W3D_ANTI_POINT         Point antialiasing
  1394.                      W3D_ANTI_LINE          Line antialiasing
  1395.                      W3D_ANTI_POLYGON       Polygon antialiasing
  1396.                      W3D_ANTI_FULLSCREEN    Fullscreen antialiasing
  1397.                      W3D_DITHERING          dithering state
  1398.                      W3D_LOGICOP            logical operations state
  1399.                      W3D_STENCILBUFFER      stencil buffer state
  1400.                      W3D_ALPHATEST          Alpha test state
  1401.                      W3D_SPECULAR           Specular highlightung state
  1402.                      W3D_TEXMAPPING3D       3D texturemapping state
  1403.  
  1404.    RESULT
  1405.        One of the following:
  1406.            W3D_ENABLED     the mode is enabled
  1407.            W3D_DISABLED    the mode is disabled/not available
  1408.  
  1409.    EXAMPLE
  1410.        if (W3D_ENABLED == W3D_GetState(context, W3D_FOGGING)) {
  1411.            printf("Gee, I can`t see in all this fog\n");
  1412.        } else {
  1413.            printf("Aha, that`s better\n");
  1414.        }
  1415.  
  1416.    NOTES
  1417.         Don't use W3D_SYNCHRON, this state might only be useful for
  1418.         debugging purposes.
  1419.  
  1420.         The W3D_FAST mode can speed up your application, always use it,
  1421.         if you don't care what happens to the values in the drawing
  1422.         structures (like W3D_Triangle, W3D_Line etc.)
  1423.  
  1424.         'Indirect drawing' has the advantage, that the 'locking' time
  1425.         is minimized, please provide at least an option for the user to
  1426.         use it.
  1427.  
  1428.         For more information about the different states, please refer
  1429.         to the Warp3D Programmer Documentation.
  1430.  
  1431.    BUGS
  1432.  
  1433.    SEE ALSO
  1434.        W3D_SetState
  1435.  
  1436. Warp3D/W3D_GetTexFmtInfo                                    Warp3D/W3D_GetTexFmtInfo
  1437.  
  1438.    NAME   
  1439.        W3D_GetTexFmtInfo -- Get information about the texture format
  1440.  
  1441.    SYNOPSIS
  1442.        info = W3D_GetTexFmtInfo(context, format, destfmt);
  1443.        d0                       a0       d0      d1
  1444.  
  1445.        ULONG W3D_GetTexInfo(W3D_Context, ULONG, ULONG);
  1446.  
  1447.    FUNCTION
  1448.        This function is used to get information about the texture
  1449.        format, i.e. if it`s directly supported by the hardware,
  1450.        or must be converted in some way.
  1451.  
  1452.    INPUTS
  1453.        context - A valid context pointer
  1454.        texfmt  - The texture format to be queried. Currently,
  1455.                  one of the following:
  1456.                    W3D_CHUNKY           palettized
  1457.                    W3D_A1R5G5B5         a rrrrr ggggg bbbbb
  1458.                    W3D_R5G6B5           rrrrr gggggg bbbbb
  1459.                    W3D_R8G8B8           rrrrrrrr gggggggg bbbbbbbb
  1460.                    W3D_A4R4G4B4         aaaa rrrr gggg bbbb
  1461.                    W3D_A8R8G8B8         aaaaaaaa rrrrrrrr gggggggg bbbbbbbb
  1462.                    W3D_R8G8B8A8         rrrrrrrr gggggggg bbbbbbbb aaaaaaaa
  1463.                    W3D_A8               aaaaaaaa
  1464.                    W3D_L8               llllllll
  1465.                    W3D_L8A8             llllllll aaaaaaaa
  1466.                    W3D_I8               iiiiiiii
  1467.                  See the main documentation for more information.
  1468.        destfmt - The destination screen format.
  1469.  
  1470.    RESULT
  1471.        A bitvector with the following bits
  1472.            W3D_TEXFMT_FAST         Format directly supported by HW
  1473.            W3D_TEXFMT_CLUTFAST     Format directly supported in CLUT modes only
  1474.            W3D_TEXFMT_ARGBFAST     Format directly supported in direct color
  1475.                                        modes only
  1476.            W3D_TEXFMT_UNSUPPORTED  Format not supported, and can't be emulated
  1477.            W3D_TEXFMT_SUPPORTED    Format is supported, although it may be
  1478.                                        internally converted
  1479.  
  1480.    EXAMPLE
  1481.        ULONG info = W3D_GetTexFmtInfo(NULL, W3D_CHUNKY, W3D_FMT_CLUT);
  1482.        if (info & W3D_TEXFMT_CLUTFAST) printf("Supported in CLUT modes\n");
  1483.  
  1484.    NOTES
  1485.        Formats that are not directly supported can still be used for textures.
  1486.        Note, however, that those textures must be converted.
  1487.  
  1488.        IMPORTANT: Prior to Version 2 of the API, this function could be
  1489.        called with a NULL context to query the default driver. Although this
  1490.        is still possible for backward compatibility reasons, a programmer
  1491.        must not use this feature in new projects, but rather use the new and
  1492.        improved W3D_GetDriverTexFmtInfo() function instead, which is essential
  1493.        for multiple driver support. You may still call this function with a
  1494.        valid context, of course.
  1495.  
  1496.    BUGS
  1497.  
  1498.    SEE ALSO
  1499.        W3D_GetDriverTexFmtInfo()
  1500.  
  1501. Warp3D/W3D_Hint                                                      Warp3D/W3D_Hint
  1502.  
  1503.    NAME   
  1504.        W3D_Hint -- Hint about rendering quality
  1505.  
  1506.    SYNOPSIS
  1507.        result = W3D_Hint(context, mode, quality);
  1508.        d0                a0       d0    d1
  1509.  
  1510.        ULONG W3D_Hint(W3D_Context, ULONG, ULONG);
  1511.  
  1512.    FUNCTION
  1513.        Gives Warp3D a hint about the desired quality of some
  1514.        effects. This can be used to improve rendering speed
  1515.        at the cost of display quality.
  1516.  
  1517.    INPUTS
  1518.        context - The context to hint for
  1519.        mode    - The mode to hint for. One of the following values
  1520.                    W3D_H_TEXMAPPING      - quality of general texmapping
  1521.                    W3D_H_MIPMAPPING      - quality of mipmapping
  1522.                    W3D_H_BILINEARFILTER  - quality of bilinear filtering
  1523.                    W3D_H_MMFILTER        - quality of depth filter
  1524.                    W3D_H_PERSPECTIVE     - quality of perspective correction
  1525.                    W3D_H_BLENDING        - quality of alpha blending
  1526.                    W3D_H_FOGGING         - quality of fogging
  1527.                    W3D_H_ANTIALIASING    - quality of antialiasing
  1528.                    W3D_H_DITHERING       - quality of dithering
  1529.                    W3D_H_ZBUFFER         - quality of ZBuffering
  1530.        quality - The desired quality. Possible  values are
  1531.                    W3D_H_FAST            - fast, low quality
  1532.                    W3D_H_AVERAGE         - average speed, average quality
  1533.                    W3D_H_NICE            - low speed, high quality
  1534.  
  1535.  
  1536.    RESULT
  1537.        A value indicating success or failure:
  1538.            W3D_SUCCESS         Success
  1539.            W3D_ILLEGALINPUT    Failure, illegal input
  1540.  
  1541.    EXAMPLE
  1542.  
  1543.    NOTES
  1544.        This function only gives hints to Warp3D. It is possible
  1545.        that it doesn't do anything at all, depending on the
  1546.        possibility the hardware or driver offers.
  1547.  
  1548.    BUGS
  1549.        The ViRGE driver selects it`s filter modes when they are set
  1550.        with W3D_SetFilter, so you have to set the filter modes again
  1551.        when messing with the W3D_H_BILINEARFILTER setting.
  1552.  
  1553.    SEE ALSO
  1554.  
  1555. Warp3D/W3D_LockHardware                                      Warp3D/W3D_LockHardware
  1556.  
  1557.    NAME   
  1558.        W3D_LockHardware -- Gain exclusive hardware access
  1559.  
  1560.    SYNOPSIS
  1561.        res = W3D_LockHardware(context);
  1562.        d0                     a0
  1563.  
  1564.        ULONG W3D_LockHardware(W3D_Context *);
  1565.  
  1566.    FUNCTION
  1567.        This function gains exclusive access to the hardware. It must be
  1568.        called whenever objects are drawn, except when operating in 'indirect
  1569.        render' mode. You should not lock the frame too long, because the
  1570.        system is freezed in locked state.
  1571.  
  1572.    INPUTS
  1573.        context - a pointer to a W3D_Context structure
  1574.  
  1575.    RESULT
  1576.        A value indication success or failure:
  1577.            W3D_SUCCESS     - The hardware is locked
  1578.            W3D_NOTVISIBLE  - The bitmap is not visible/swapped out of vmem
  1579.  
  1580.    EXAMPLE
  1581.        if (W3D_SUCCESS == W3D_LockHardware(context) {
  1582.            ...
  1583.            Render some stuff
  1584.            ...
  1585.            W3D_UnLockHardware(context);
  1586.        } else {
  1587.            printf("Can`t lock hardware\n");
  1588.        }
  1589.  
  1590.    NOTES
  1591.        This function may forbid multitasking (depending on the driver),
  1592.        or even disable interrupts.
  1593.  
  1594.    BUGS
  1595.  
  1596.    SEE ALSO
  1597.        W3D_UnLockHardware, W3D_SetState
  1598.  
  1599. Warp3D/W3D_Query                                                    Warp3D/W3D_Query
  1600.  
  1601.    NAME   
  1602.        W3D_Query -- Query capabilities of the driver
  1603.  
  1604.    SYNOPSIS
  1605.        res = W3D_Query(context, query, destfmt)
  1606.        d0              a0       d0     d1
  1607.  
  1608.        ULONG W3D_Query(W3D_Context *, ULONG, ULONG);
  1609.  
  1610.    FUNCTION
  1611.        This function is used to query the hardware/driver
  1612.        capabilities. It takes destination formats into account
  1613.        (checking compatibility).
  1614.  
  1615.    INPUTS
  1616.        context     - pointer to a W3D_Context
  1617.        query       - a value to be queried.
  1618.                      Currently, the following values are supported:
  1619.                        W3D_Q_DRAW_POINT         point drawing
  1620.                        W3D_Q_DRAW_LINE          line drawing
  1621.                        W3D_Q_DRAW_TRIANGLE      triangle drawing
  1622.                        W3D_Q_DRAW_POINT_X       points with size != 1 supported
  1623.                        W3D_Q_DRAW_LINE_X        lines with width != 1 supported
  1624.                        W3D_Q_DRAW_LINE_ST       line stippling supported
  1625.                        W3D_Q_DRAW_POLY_ST       polygon stippling supported
  1626.                        W3D_Q_TEXMAPPING         texmapping in general
  1627.                        W3D_Q_MIPMAPPING         mipmapping
  1628.                        W3D_Q_BILINEARFILTER     bilinear filter
  1629.                        W3D_Q_MMFILTER           mipmap filter
  1630.                        W3D_Q_LINEAR_REPEAT      W3D_REPEAT for linear texmapping
  1631.                        W3D_Q_LINEAR_CLAMP       W3D_CLAMP for linear texmapping
  1632.                        W3D_Q_PERPESCTIVE        perspective correction
  1633.                        W3D_Q_PERSP_REPEAT       W3D_REPEAT for persp. texmapping
  1634.                        W3D_Q_PERSP_CLAMP        W3D_CLAMP for persp. texmapping
  1635.                        W3D_Q_ENV_REPLACE        texenv REPLACE
  1636.                        W3D_Q_ENV_DECAL          texenv DECAL
  1637.                        W3D_Q_ENV_MODULATE       texenv MODULATE
  1638.                        W3D_Q_ENV_BLEND          texenv BLEND
  1639.                        W3D_Q_FLATSHADING        flat shading
  1640.                        W3D_Q_GOURAUDSHADING     gouraud shading
  1641.                        W3D_Q_ZBUFFER            Z buffer in general
  1642.                        W3D_Q_ZBUFFERUPDATE      Z buffer update
  1643.                        W3D_Q_ZCOMPAREMODES      Z buffer compare modes
  1644.                        W3D_Q_ALPHATEST          alpha test in general
  1645.                        W3D_Q_ALPHATESTMODES     alpha test modes
  1646.                        W3D_Q_BLENDING           alpha blending
  1647.                        W3D_Q_SRCFACTORS         source factors
  1648.                        W3D_Q_DESTFACTORS        destination factors
  1649.                        W3D_Q_FOGGING            fogging in general
  1650.                        W3D_Q_LINEAR             linear fogging
  1651.                        W3D_Q_EXPONENTIAL        exponential fogging
  1652.                        W3D_Q_S_EXPONENTIAL      square exponential fogging
  1653.                        W3D_Q_ANTIALIASING       antialiasing in general
  1654.                        W3D_Q_ANTI_POINT         point antialiasing
  1655.                        W3D_Q_ANTI_LINE          line antialiasing
  1656.                        W3D_Q_ANTI_POLYGON       polygon antialiasing
  1657.                        W3D_Q_ANTI_FULLSCREEN    fullscreen antialiasing
  1658.                        W3D_Q_DITHERING          dithering
  1659.                        W3D_Q_SCISSOR            scissor test
  1660.                        W3D_Q_MAXTEXWIDTH        max. texture width
  1661.                        W3D_Q_MAXTEXHEIGHT       max. texture height
  1662.                        W3D_Q_RECTTEXTURES       rectangular textures
  1663.                        W3D_Q_LOGICOP            logical operations
  1664.                        W3D_Q_MASKING            color/index masking
  1665.                        W3D_Q_STENCILBUFFER      stencil buffer in general
  1666.                        W3D_Q_STENCIL_MASK       mask value
  1667.                        W3D_Q_STENCIL_FUNC       stencil functions
  1668.                        W3D_Q_STENCIL_SFAIL      stencil operation SFAIL
  1669.                        W3D_Q_STENCIL_DPFAIL     stencil operation DPFAIL
  1670.                        W3D_Q_STENCIL_DPPASS     stencil operation DPPASS
  1671.                        W3D_Q_STENCIL_WRMASK     stencil buffer supports write maskin
  1672. g
  1673.                        W3D_Q_PALETTECONV        driver can use texture with a pallet
  1674. te
  1675.                                                    other than the screen palette on
  1676.                                                    8 bit screens
  1677.                        W3D_Q_DRAW_POINT_FX     driver supports point fx (fog, zbuffe
  1678. r)
  1679.                        W3D_Q_DRAW_POINT_TEX    driver supports points textured
  1680.                        W3D_Q_DRAW_LINE_FX      driver supports line fx
  1681.                        W3D_Q_DRAW_LINE_TEX     driver supports textured lines
  1682.                        W3D_Q_SPECULAR          driver supports specular reflection
  1683.        destfmt     - The destination format
  1684.  
  1685.    RESULT
  1686.        Depends on the item. With most of the "is this supported"-type
  1687.        queries, one of the following constants is returned:
  1688.            W3D_FULLY_SUPPORTED     Completely supported by driver
  1689.            W3D_PARTIALLY_SUPPORTED Only partially supported
  1690.            W3D_NOT_SUPPORTED       Not supported
  1691.  
  1692.        With "what is the value"-type queries like W3D_Q_MAXTEXWIDTH,
  1693.        an ULONG is returned.
  1694.  
  1695.    EXAMPLE
  1696.        switch(W3D_Query(context, W3D_Q_TEXMAPING, destfmt)) {
  1697.        case W3D_FULLY_SUPPORTED:     printf("Completely supported by driver\n");
  1698.                                      break;
  1699.        case W3D_PARTIALLY_SUPPORTED: printf("Only partially supported\n");
  1700.                                      break;
  1701.        case W3D_NOT_SUPPORTED:       printf("Not supported\n");
  1702.                                      break;
  1703.        }
  1704.  
  1705.    NOTES
  1706.        Regarding chunky/ARGB combinations:
  1707.        You are advised that you always use chunky textures with chunky
  1708.        screens only, and ARGB textures with ARGB screens
  1709.  
  1710.        IMPORTANT: Prior to Version 2 of the API, the W3D_Query function
  1711.        could be called with a NULL pointer instead of a context. Although
  1712.        this possibility is still supported for backward compatibility,
  1713.        the programmer is strictly encouraged to use the new W3D_QueryDriver
  1714.        function instead. The W3D_QueryDriver function may be used to directly
  1715.        query a specific driver for capabilities, which is essential when
  1716.        working with V2+ and multiple drivers.
  1717.  
  1718.    BUGS
  1719.  
  1720.    SEE ALSO
  1721.        W3D_QueryDriver()
  1722.  
  1723. Warp3D/W3D_QueryDriver                                        Warp3D/W3D_QueryDriver
  1724.  
  1725.    NAME
  1726.        W3D_QueryDriver -- Query capabilities of any driver (V2)
  1727.  
  1728.    SYNOPSIS
  1729.        res = W3D_QueryDriver(driver, query, destfmt)
  1730.        d0                    a0       d0     d1
  1731.  
  1732.        ULONG W3D_QueryDriver(W3D_Driver *, ULONG, ULONG);
  1733.  
  1734.    FUNCTION
  1735.        This function is similar to the W3D_Query function, only
  1736.        that it does not require a context but rather operates on
  1737.        a driver obtained by W3D_GetDrivers().
  1738.  
  1739.    INPUTS
  1740.        driver  -   A pointer to a W3D_Driver structure obtained by
  1741.                    W3D_GetDrivers()
  1742.        query   -   The data item to be queried. See W3D_Query() for
  1743.                    a list of available query items.
  1744.        destfmt -   The destination format you intend to use.
  1745.  
  1746.    RESULT
  1747.        One of the following values is returned:
  1748.            W3D_FULLY_SUPPORTED     Completely supported by driver
  1749.            W3D_PARTIALLY_SUPPORTED Only partially supported
  1750.            W3D_NOT_SUPPORTED       Not supported
  1751.  
  1752.    EXAMPLE
  1753.  
  1754.    NOTES
  1755.  
  1756.    BUGS
  1757.  
  1758.    SEE ALSO
  1759.        W3D_Query(), W3D_GetDrivers()
  1760.  
  1761. Warp3D/W3D_ReadStencilPixel                              Warp3D/W3D_ReadStencilPixel
  1762.  
  1763.    NAME   
  1764.        W3D_ReadStencilPixel -- Read a pixel from the stencil buffer
  1765.  
  1766.    SYNOPSIS
  1767.        success = W3D_ReadStencilPixel(context, x, y, st);
  1768.        d0                             a0       d0 d1 a1
  1769.  
  1770.        ULONG W3D_ReadStencilPixel(W3D_Context *, ULONG, ULONG, ULONG *);
  1771.  
  1772.    FUNCTION
  1773.        Read the stencil buffer pixel at x,y into the variable pointed
  1774.        to by st.
  1775.        This function may only be used while the hardware is locked,
  1776.        except when indirect drawing is used.
  1777.  
  1778.    INPUTS
  1779.        context - The context to use
  1780.        x,y     - Coordinates of point
  1781.        st      - Pointer to a variable to hold the read pixel
  1782.  
  1783.    RESULT
  1784.        One of the following values:
  1785.            W3D_SUCCESS         Operation successful
  1786.            W3D_NOSTENCILBUFFER No stencil buffer present
  1787.            W3D_NOTVISIBLE      The stencil buffer can not be accessed by
  1788.                                    the hardware
  1789.            W3D_NOTVISIBLE      Indirect mode only. Locking failed.
  1790.  
  1791.    EXAMPLE
  1792.  
  1793.    NOTES
  1794.         This function is primarly intended for OpenGL implementations,
  1795.         which might need access to the stencil buffer. This function
  1796.         is slow and should normally not be called.
  1797.  
  1798.         Important note: In indirect mode you have to make sure, that
  1799.         the stencil buffer is up to date, no Flush is internally done
  1800.         by this function. You have to call W3D_Flush, if the stencil
  1801.         buffer is not up to date yet.
  1802.  
  1803.    BUGS
  1804.         Indirect mode: the hardware is internally not locked for
  1805.         performance reasons, therefore the result might be wrong, if
  1806.         the corresponding buffer is swapped out.
  1807.  
  1808.    SEE ALSO
  1809.        W3D_ReadStencilSpan
  1810.  
  1811. Warp3D/W3D_ReadStencilSpan                                Warp3D/W3D_ReadStencilSpan
  1812.  
  1813.    NAME   
  1814.        W3D_ReadStencilSpan -- Read a range of stencil buffer pixels
  1815.  
  1816.    SYNOPSIS
  1817.        success = W3D_ReadStencilSpan(context, x, y, n, st);
  1818.        d0                            a0       d0 d1 d2 a1
  1819.  
  1820.        ULONG W3D_ReadStencilSpan(W3D_Context *, ULONG, ULONG, ULONG,
  1821.                     ULONG []);
  1822.  
  1823.    FUNCTION
  1824.        Read a span of pixel value from the stencil buffer. The resulting
  1825.        pixels are put into the memory area pointed to by st.
  1826.        This function may only be used while the hardware is locked,
  1827.        except when indirect drawing is used.
  1828.  
  1829.    INPUTS
  1830.        context - The context
  1831.        x,y     - Coordinates of span start
  1832.        n       - Number of pixels to read
  1833.        st      - pointer to the array to hold the pixel
  1834.  
  1835.    RESULT
  1836.        One of the following values:
  1837.            W3D_SUCCESS             Operation successful
  1838.            W3D_NOSTENCILBUFFER     No stencil buffer found
  1839.            W3D_NOTVISIBLE          The stencil buffer can not be accessed by
  1840.                                        the hardware
  1841.            W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  1842.  
  1843.    EXAMPLE
  1844.  
  1845.    NOTES
  1846.         If you need to read more than one consecutive pixel, use this
  1847.         function instead of calling the single pixel version repeatedly.
  1848.  
  1849.         This function is primarly intended for OpenGL implementations,
  1850.         which might need access to the stencil buffer. This function
  1851.         is slow and should normally not be called.
  1852.  
  1853.         Important note: In indirect mode you have to make sure, that
  1854.         the stencil buffer is up to date, no Flush is internally done
  1855.         by this function. You have to call W3D_Flush, if the stencil
  1856.         buffer is not up to date yet.
  1857.  
  1858.    BUGS
  1859.         Indirect mode: the hardware is internally not locked for
  1860.         performance reasons, therefore the result might be wrong, if
  1861.         the corresponding buffer is swapped out.
  1862.  
  1863.    SEE ALSO
  1864.        W3D_ReadStencilPixel
  1865.  
  1866. Warp3D/W3D_ReadZPixel                                          Warp3D/W3D_ReadZPixel
  1867.  
  1868.    NAME   
  1869.        W3D_ReadZPixel -- Read a pixel value from the ZBuffer
  1870.  
  1871.    SYNOPSIS
  1872.        success = W3D_ReadZPixel(context, x, y, z);
  1873.        d0                       a0       d0 d1 a1
  1874.  
  1875.        ULONG W3D_ReadZPixel(W3D_Context *, ULONG, ULONG, W3D_Double *);
  1876.  
  1877.    FUNCTION
  1878.        Read ZBuffer pixel x,y into variable pointed to by z;
  1879.        This function may only be used while the hardware is locked,
  1880.        except when indirect drawing is used.
  1881.  
  1882.    INPUTS
  1883.        context - pointer to the context
  1884.        x,y     - coordinates of pixel
  1885.        z       - pointer to a W3D_Double
  1886.  
  1887.    RESULT
  1888.        One of the following:
  1889.            W3D_SUCCESS     Successful operation
  1890.            W3D_NOZBUFFER   No ZBuffer was allocated
  1891.            W3D_NOTVISIBLE  ZBuffer is not visible
  1892.  
  1893.    EXAMPLE
  1894.  
  1895.    NOTES
  1896.        This function is primarly intended for OpenGL implementations,
  1897.        which might need access to the Z buffer. This function
  1898.        is slow and should normally not be called.
  1899.  
  1900.        * IMPORTANT NOTE: *
  1901.        For speed reasons, this call is *NOT* compatible with indirect drawing.
  1902.        To use this call with indirect mode, you have to manually W3D_Flush,
  1903.        and, should you use any drawing calls, you'll have to W3D_Flush again.
  1904.  
  1905.    BUGS
  1906.        Indirect mode: the hardware is internally not locked for
  1907.        performance reasons, therefore the result might be wrong, if
  1908.        the corresponding buffer is swapped out.
  1909.  
  1910.    SEE ALSO
  1911.        W3D_ReadZSpan
  1912.  
  1913. Warp3D/W3D_ReadZSpan                                            Warp3D/W3D_ReadZSpan
  1914.  
  1915.    NAME   
  1916.        W3D_ReadZSpan -- read a range of ZBuffer pixels
  1917.  
  1918.    SYNOPSIS
  1919.        success = W3D_ReadZSpan(context, x, y, n, z);
  1920.        d0                      a0       d0 d1 d2 a1
  1921.  
  1922.        ULONG W3D_ReadZSpan(W3D_Context *, ULONG, ULONG, ULONG, W3D_Double []);
  1923.  
  1924.    FUNCTION
  1925.        Read a span of ZBuffer pixels into an array pointed to by the z
  1926.        parameter.
  1927.        This function may only be used while the hardware is locked,
  1928.        except when indirect drawing is used.
  1929.  
  1930.    INPUTS
  1931.        context - Pointer to the context
  1932.        x,y     - Coordinates of pixels
  1933.        n       - Number of pixels to read
  1934.        z       - Array of W3D_Double to fill. Note that the array must
  1935.                  be large enough (i.e. at least n)
  1936.  
  1937.    RESULT
  1938.        One of the following values
  1939.            W3D_SUCCESS     Operation successful
  1940.            W3D_NOZBUFFER   No ZBuffer was allocated
  1941.            W3D_NOTVISIBLE  ZBuffer is not visible
  1942.  
  1943.    EXAMPLE
  1944.  
  1945.    NOTES
  1946.        You should use this function instead of W3D_ReadZPixel if you`re
  1947.        going to read more pixels than just one.
  1948.  
  1949.        This function is primarly intended for OpenGL implementations,
  1950.        which might need access to the Z buffer. This function
  1951.        is slow and should normally not be called.
  1952.  
  1953.        * IMPORTANT NOTE: *
  1954.        For speed reasons, this call is *NOT* compatible with indirect drawing.
  1955.        To use this call with indirect mode, you have to manually W3D_Flush,
  1956.        and, should you use any drawing calls, you'll have to W3D_Flush again.
  1957.  
  1958.    BUGS
  1959.        Indirect mode: the hardware is internally not locked for
  1960.        performance reasons, therefore the result might be wrong, if
  1961.        the corresponding buffer is swapped out.
  1962.  
  1963.  
  1964.    SEE ALSO
  1965.        W3D_ReadZPixel
  1966.  
  1967. Warp3D/W3D_ReleaseTexture                                  Warp3D/W3D_ReleaseTexture
  1968.  
  1969.    NAME   
  1970.        W3D_ReleaseTexture -- Release texture from video ram
  1971.  
  1972.    SYNOPSIS
  1973.        W3D_ReleaseTexture(context, texture);
  1974.                           a0       a1
  1975.  
  1976.        void W3D_ReleaseTexture(W3D_Context *, W3D_Texture *);
  1977.  
  1978.    FUNCTION
  1979.        Release a texture from video ram. This frees the memory
  1980.        allocated by that texture.
  1981.  
  1982.    INPUTS
  1983.        context - Pointer to a W3D_Context
  1984.        texture - Pointer to the texture to be released
  1985.  
  1986.    RESULT
  1987.        None
  1988.  
  1989.    EXAMPLE
  1990.        extern W3D_Texture *texture;
  1991.        extern W3D_Context *context;
  1992.        W3D_ReleaseTexture(context, texture);
  1993.  
  1994.    NOTES
  1995.        This call does nothing if W3D_AUTOTEXMANAGEMENT is set
  1996.        in the context`s state.
  1997.  
  1998.    BUGS
  1999.  
  2000.    SEE ALSO
  2001.        W3D_UploadTexture
  2002.  
  2003. Warp3D/W3D_RequestMode                                        Warp3D/W3D_RequestMode
  2004.  
  2005.    NAME
  2006.        W3D_RequestMode -- Request a screen mode (V2)
  2007.  
  2008.    SYNOPSIS
  2009.        ModeID = W3D_RequestMode(taglist);
  2010.           D0                     a0
  2011.  
  2012.        ULONG W3D_RequestMode(struct TagItem *);
  2013.  
  2014.    FUNCTION
  2015.        This function presents the user with an ASL-Type screen mode
  2016.        requester. The mode requester will only include those screen modes
  2017.        that are supported by the specified combination of tag items.
  2018.  
  2019.    INPUTS
  2020.        taglist - A taglist of W3D_SMR_#? items. The following items
  2021.                  are defined:
  2022.            W3D_SMR_SIZEFILTER (BOOL)
  2023.                If set to TRUE, filter ASLSM_MinWidth, ASLSM_MinHeight,
  2024.                ASLSM_MaxWidth, ASL_MaxHeight
  2025.            W3D_SMR_DRIVER (W3D_Driver *)
  2026.                A pointer to a W3D_Driver structure that you want to use.
  2027.                If this tag is specified, the screen modes in the
  2028.                requester will all be compatible with this driver.
  2029.            W3D_SMR_DESTFMT (W3D_FMT_#? constants)
  2030.                The screen/bitmap formats you want to use. If this tag
  2031.                is active, all screenmodes will be filtered accordingly.
  2032.                You may specify a bitmask to get more than one format.
  2033.            W3D_SMR_TYPE (W3D_DRIVER_3DHW/W3D_DRIVER_CPU)
  2034.                Specifies if you want to filter the screen modes according
  2035.                to the driver type. If this is set to W3D_DRIVER_CPU,
  2036.                only the active CPU driver is used for filtering. Otherwise,
  2037.                all modes of all hardware is filtered, unless the W3D_SMR_DRIVER
  2038.                tag specifies a special driver.
  2039.            ASLSM_???
  2040.                You may give an arbitrary number of ASLSM_#? tags that will be
  2041.                passed to asl.library. Most notably, these include those tags
  2042.                the localize the requester or modify the look, including position
  2043.                and size. Most notably, the ASLSM_Min#? and ASLSM_Max#? tags
  2044.                may be used in a special meaning if the W3D_SMR_SIZEFILTER
  2045.                tag item is present and set to TRUE.
  2046.  
  2047.            Not all of the combinations make sense, for example, specifiying
  2048.            W3D_SMR_TYPE together with W3D_SMR_DRIVER.
  2049.  
  2050.    RESULT
  2051.        ModeID  -   The ModeID the user selected, or INVALID_ID if the requester
  2052.                    was cancelled.
  2053.  
  2054.    EXAMPLE
  2055.  
  2056.    NOTES
  2057.  
  2058.    BUGS
  2059.  
  2060.    SEE ALSO
  2061.        W3D_SelectDriver()
  2062.  
  2063. Warp3D/W3D_SetAlphaMode                                      Warp3D/W3D_SetAlphaMode
  2064.  
  2065.    NAME   
  2066.        W3D_SetAlpha -- Set the alpha test mode
  2067.  
  2068.    SYNOPSIS
  2069.        success = W3D_SetAlphaMode(context, mode, refval);
  2070.        d0                         a0       d1    a1
  2071.  
  2072.        ULONG W3D_SetAlphaMode(W3D_Context, ULONG, W3D_Float *);
  2073.  
  2074.    FUNCTION
  2075.        This function defines the way the alpha test is performed.
  2076.        This test compares the incoming pixel's alpha value
  2077.        with the reference value, and decides, depending on the set
  2078.        mode, if the pixel is discarded or not.
  2079.  
  2080.    INPUTS
  2081.        context  - The context
  2082.        mode     - The alpha test mode. One of the following:
  2083.                   W3D_A_NEVER       Always discard
  2084.                   W3D_A_LESS        Draw, if value < refvalue
  2085.                   W3D_A_GEQUAL      Draw, if value >= refvalue
  2086.                   W3D_A_LEQUAL      Draw, if value <= refvalue
  2087.                   W3D_A_GREATER     Draw, if value > refvalue
  2088.                   W3D_A_NOTEQUAL    Draw, if value != refvalue
  2089.                   W3D_A_ALWAYS      always draw
  2090.        refvalue - Pointer to the alpha reference value. Must be in
  2091.                   the interval [0..1]
  2092.  
  2093.    RESULT
  2094.        One of the following:
  2095.            W3D_SUCCESS             Success
  2096.            W3D_ILLEGALINPUT        Illegal alpha mode
  2097.            W3D_UNSUPPORTEDATEST    Alpha test unsupported
  2098.            W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2099.  
  2100.    EXAMPLE
  2101.  
  2102.    NOTES
  2103.        Alpha testing is probably not supported on older 3D hardware.
  2104.  
  2105.    BUGS
  2106.  
  2107.    SEE ALSO
  2108.  
  2109. Warp3D/W3D_SetBlendMode                                      Warp3D/W3D_SetBlendMode
  2110.  
  2111.    NAME   
  2112.        W3D_SetBlendMode -- Set the blending mode
  2113.  
  2114.    SYNOPSIS
  2115.        success = W3D_SetBlendMode(context, srcfunc, dstfunc);
  2116.        d0                         a0       d0       d1
  2117.  
  2118.        ULONG W3D_SetBlendMode(W3D_Context *, ULONG, ULONG);
  2119.  
  2120.    FUNCTION
  2121.        Sets the blending mode. Blending has to be enabled using
  2122.        W3D_SetState. For more information about the blending modes, see
  2123.        the OpenGL specs.
  2124.  
  2125.    INPUTS
  2126.        context - pointer to the W3D_Context
  2127.        srcfunc - The mode for the source pixel. Values are:
  2128.                    W3D_ZERO
  2129.                    W3D_ONE
  2130.                    W3D_DST_COLOR
  2131.                    W3D_ONE_MINUS_DST_COLOR
  2132.                    W3D_SRC_ALPHA
  2133.                    W3D_ONE_MINUS_SRC_ALPHA
  2134.                    W3D_DST_ALPHA
  2135.                    W3D_ONE_MINUS_DST_ALPHA
  2136.                    W3D_SRC_ALPHA_SATURATE
  2137.                    W3D_CONSTANT_COLOR
  2138.                    W3D_ONE_MINUS_CONSTANT_COLOR
  2139.                    W3D_CONSTANT_ALPHA
  2140.                    W3D_ONE_MINUS_CONSTANT_ALPHA
  2141.        dstfunc - Mode for the destination:
  2142.                    W3D_ZERO
  2143.                    W3D_ONE
  2144.                    W3D_SRC_COLOR
  2145.                    W3D_ONE_MINUS_SRC_COLOR
  2146.                    W3D_SRC_ALPHA
  2147.                    W3D_ONE_MINUS_SRC_ALPHA
  2148.                    W3D_DST_ALPHA
  2149.                    W3D_ONE_MINUS_DST_ALPHA
  2150.                    W3D_CONSTANT_COLOR
  2151.                    W3D_ONE_MINUS_CONSTANT_COLOR
  2152.                    W3D_CONSTANT_ALPHA
  2153.                    W3D_ONE_MINUS_CONSTANT_ALPHA
  2154.  
  2155.    RESULT
  2156.        One of the following:
  2157.            W3D_SUCCESS             Success
  2158.            W3D_ILLEGALINPUT        Illegal alpha blend mode
  2159.            W3D_UNSUPPORTEDBLEND    Mode is not supported by current driver
  2160.            W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2161.  
  2162.    EXAMPLE
  2163.  
  2164.    NOTES
  2165.  
  2166.    BUGS
  2167.  
  2168.    SEE ALSO
  2169.        W3D_SetState, W3D_GetState
  2170.  
  2171. Warp3D/W3D_SetColorMask                                      Warp3D/W3D_SetColorMask
  2172.  
  2173.    NAME   
  2174.        W3D_SetColorMask -- Set mask for drawing
  2175.  
  2176.    SYNOPSIS
  2177.        success = W3D_SetColorMask(context, red, green, blue, alpha);
  2178.        d0                         a0       d0   d1     d2    d3
  2179.  
  2180.        ULONG W3D_SetColorMask(W3D_Context *, W3D_Bool, W3D_Bool, W3D_Bool,
  2181.            W3D_Bool);
  2182.  
  2183.    FUNCTION
  2184.        This function defines the mask for all drawing operations in
  2185.        direct color mode (15/16/24/32 bit modes).
  2186.  
  2187.    INPUTS
  2188.        context     - the context
  2189.        red
  2190.        green
  2191.        blue
  2192.        alpha       - If set to FALSE, the component should be masked out.
  2193.  
  2194.    RESULT
  2195.        W3D_SUCCESS             Success
  2196.        W3D_MASKNOTSUPPORTED    Masking is not supported by the current driver
  2197.        W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2198.  
  2199.    EXAMPLE
  2200.  
  2201.    NOTES
  2202.  
  2203.    BUGS
  2204.  
  2205.    SEE ALSO
  2206.        W3D_SetPenMask
  2207.  
  2208. Warp3D/W3D_SetCurrentColor                                Warp3D/W3D_SetCurrentColor
  2209.  
  2210.    NAME   
  2211.        W3D_SetCurrentColor -- Set color for single-color operations
  2212.  
  2213.    SYNOPSIS
  2214.        ret = W3D_SetCurrentColor(context, color);
  2215.                                  a0       a1
  2216.  
  2217.        ULONG W3D_SetCurrentColor(W3D_Context *, W3D_Color *);
  2218.  
  2219.    FUNCTION
  2220.        Defines the color to use for operations where one single color
  2221.        is used, i.e. flat-shaded opbjects. This color is only used for
  2222.        RGBA destinations.
  2223.  
  2224.    INPUTS
  2225.        context - Context pointer
  2226.        color   - Pointer to a color to use
  2227.  
  2228.    RESULT
  2229.        W3D_QUEUFAIL    Queueing failed in indirect mode
  2230.        W3D_NOTVISIBLE  Locking failed in indirect mode
  2231.  
  2232.    EXAMPLE
  2233.  
  2234.    NOTES
  2235.  
  2236.    BUGS
  2237.  
  2238.    SEE ALSO
  2239.  
  2240. Warp3D/W3D_SetCurrentPen                                    Warp3D/W3D_SetCurrentPen
  2241.  
  2242.    NAME   
  2243.        W3D_SetCurrentPen -- Set pen for single-color operations
  2244.  
  2245.    SYNOPSIS
  2246.        W3D_SetCurrentPen(context, pen);
  2247.                          a0       d1
  2248.  
  2249.        void W3D_SetCurrentPen(W3D_Context *, ULONG);
  2250.  
  2251.    FUNCTION
  2252.        Define the pen to use for single-color operations, such as flat-shaded
  2253.        objects. The pen setting is olny used for chunky destinations.
  2254.  
  2255.    INPUTS
  2256.        context - a context pointer
  2257.        pen     - the pen number to use
  2258.  
  2259.    RESULT
  2260.        W3D_QUEUFAIL    Queueing failed in indirect mode
  2261.        W3D_NOTVISIBLE  Locking failed in indirect mode
  2262.  
  2263.    EXAMPLE
  2264.  
  2265.    NOTES
  2266.  
  2267.    BUGS
  2268.  
  2269.    SEE ALSO
  2270.  
  2271. Warp3D/W3D_SetDrawRegion                                    Warp3D/W3D_SetDrawRegion
  2272.  
  2273.    NAME   
  2274.        W3D_SetDrawRegion -- Set the clipping rectangle
  2275.  
  2276.    SYNOPSIS
  2277.        success = W3D_SetDrawRegion(context, bm, yoffset, scissor);
  2278.        d0                          a0       a1  d1       a2
  2279.  
  2280.        ULONG W3D_SetDrawRegion(W3D_Context *, struct BitMap *, ULONG,
  2281.                W3D_Scissor *);
  2282.  
  2283.    FUNCTION
  2284.        This function defines/changes the current drawing region.
  2285.        It's used for multibuffering and clipping.
  2286.  
  2287.    INPUTS
  2288.        context - The context
  2289.        bm      - The bitmap to draw to. If NULL, the old bitmap is used
  2290.        yoffset - The vertical offset for the top-left edge. Used for
  2291.                  multibuffering.
  2292.        scissor - If not NULL, defines the scissoring region. All values
  2293.                  are taken to be relative to (0, yoffset) in the bitmap.
  2294.  
  2295.  
  2296.    RESULT
  2297.        One of the following:
  2298.            W3D_SUCCESS         Success.
  2299.            W3D_ILLEGALBITMAP   Illegal bitmap
  2300.            W3D_UNSUPPORTEDFMT  Unsupported format
  2301.            W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2302.  
  2303.    EXAMPLE
  2304.  
  2305.    NOTES
  2306.        Due to constraints on bitmap placement in some drivers, bitmap data
  2307.        must be aligned to 8 byte boundaries
  2308.  
  2309.    BUGS
  2310.  
  2311.    SEE ALSO
  2312.  
  2313. Warp3D/W3D_SetDrawRegionWBM                              Warp3D/W3D_SetDrawRegionWBM
  2314.  
  2315.    NAME
  2316.        W3D_SetDrawRegionWBM -- Set the clipping rectangle for a W3D_Bitmap
  2317.  
  2318.    SYNOPSIS
  2319.        success = W3D_SetDrawRegion(context, bm, scissor);
  2320.        d0                          a0       a1  a2
  2321.  
  2322.        ULONG W3D_SetDrawRegion(W3D_Context *, W3D_Bitmap *, W3D_Scissor *);
  2323.  
  2324.    FUNCTION
  2325.        This function defines/changes the current drawing region.
  2326.        It's used for multibuffering and clipping.
  2327.        The only difference to W3D_SetDrawRegion is the bitmap used.
  2328.  
  2329.    INPUTS
  2330.        context - The context
  2331.        bm      - The bitmap to draw to. If NULL, the old bitmap is used
  2332.        scissor - If not NULL, defines the scissoring region. All values
  2333.                  are taken to be relative to (0, yoffset) in the bitmap.
  2334.  
  2335.    RESULT
  2336.        One of the following:
  2337.            W3D_SUCCESS         Success.
  2338.            W3D_ILLEGALBITMAP   Illegal bitmap
  2339.            W3D_UNSUPPORTEDFMT  Unsupported format
  2340.  
  2341.    EXAMPLE
  2342.  
  2343.    NOTES
  2344.  
  2345.    BUGS
  2346.  
  2347.    SEE ALSO
  2348.        W3D_SetDrawRegion
  2349.  
  2350. Warp3D/W3D_SetFilter                                            Warp3D/W3D_SetFilter
  2351.  
  2352.    NAME   
  2353.        W3D_SetFilter -- Set the filter method
  2354.  
  2355.    SYNOPSIS
  2356.        res = W3D_SetFilter(context, texture, MinFilter, MagFilter);
  2357.        d0                  a0       a1       d0         d1
  2358.  
  2359.        ULONG W3D_SetFilter(W3D_Context *, W3D_Texture *, ULONG,
  2360.                ULONG);
  2361.  
  2362.    FUNCTION
  2363.        Set the texture`s filter mode. The filter mode used is
  2364.        texture dependant, so it is possible to set different
  2365.        filter modes for different texture.
  2366.  
  2367.    INPUTS
  2368.        context     - Pointer to a W3D_Context
  2369.        texture     - Pointer to the texture to be modified
  2370.        MinFilter   - Minification filter. May be one of the following:
  2371.                      W3D_NEAREST               no mipmapping, no filtering
  2372.                      W3D_LINEAR                no mipmapping, bilinear filtering
  2373.                      W3D_NEAREST_MIP_NEAREST   mippmapping, no filtering
  2374.                      W3D_LINEAR_MIP_NEAREST    mipmapping, bilinear filtering
  2375.                      W3D_NEAREST_MIP_LINEAR    mipmapping filtered, no filtering on 
  2376. texture
  2377.                      W3D_LINEAR_MIP_LINEAR     mippmapping with trilinear filtering
  2378.        MagFilter   - Magnification filter. One of these:
  2379.                      W3D_NEAREST               no filtering
  2380.                      W3D_LINEAR                Bilinear filtering
  2381.  
  2382.    RESULT
  2383.        A value indicating success of failure. May be one of the following:
  2384.            W3D_SUCCESS             Success
  2385.            W3D_ILLEGALINPUT        Illegal values for Min/MagFilter
  2386.            W3D_UNSUPPORTEDFILTER   Desired filter not supported by driver
  2387.            W3D_WARNING             Success, but the filter mode was adjusted,
  2388.                                      because *_MIP_* was given for a texture
  2389.                                      without mipmaps
  2390.            W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2391.  
  2392.    EXAMPLE
  2393.  
  2394.    NOTES
  2395.        Some hardware may ignore the MagFilter. In this case, the MinFilter
  2396.        is used even if the texture is enlarged.
  2397.  
  2398.    BUGS
  2399.  
  2400.    SEE ALSO
  2401.        W3D_Query, W3D_GetTexFmtInfo
  2402.  
  2403. Warp3D/W3D_SetFogParams                                      Warp3D/W3D_SetFogParams
  2404.  
  2405.    NAME   
  2406.        W3D_SetFogParams -- Set fog parameters
  2407.  
  2408.    SYNOPSIS
  2409.        success = W3D_SetFogParams(context, fogparams, fogmode);
  2410.        d0                         a0       a1         d1
  2411.  
  2412.        ULONG W3D_SetFogParams(W3D_Context *, W3D_Fog *, ULONG);
  2413.  
  2414.    FUNCTION
  2415.        This function defines fogging parameters and modes.
  2416.  
  2417.    INPUTS
  2418.        context     - The context to be modified
  2419.        fogparams   - Pointer to a W3D_Fog.
  2420.        fogmode     - The type of fog.
  2421.                        W3D_FOG_LINEAR  Linear fog
  2422.                        W3D_FOG_EXP     Exponential fog
  2423.                        W3D_FOG_EXP_2   Square exponential fogging
  2424.  
  2425.    RESULT
  2426.        One of the following:
  2427.            W3D_SUCCESS         Success
  2428.            W3D_ILLEGALINPUT    Illegal input
  2429.            W3D_UNSUPPORTEDFOG  Fog mode is not supported by current driver
  2430.            W3D_NOTVISIBLE      Indirect mode only. Locking failed.
  2431.  
  2432.    EXAMPLE
  2433.  
  2434.    NOTES
  2435.  
  2436.    BUGS
  2437.  
  2438.    SEE ALSO
  2439.  
  2440. Warp3D/W3D_SetLogicOp                                          Warp3D/W3D_SetLogicOp
  2441.  
  2442.    NAME   
  2443.        W3D_SetLogicOp -- Define logical operation
  2444.  
  2445.    SYNOPSIS
  2446.        success = W3D_SetLogicOp(context, operation);
  2447.        d0                       a0       d1
  2448.  
  2449.        ULONG W3D_SetLogicOp(W3D_Context *, ULONG);
  2450.  
  2451.    FUNCTION
  2452.        Set the logical operation. For further information, see the OpenGL
  2453.        specs.
  2454.  
  2455.    INPUTS
  2456.        context     - Same as ever
  2457.        operation   - The logical operation desired. Possible values are:
  2458.                        W3D_LO_CLEAR            dest = 0
  2459.                        W3D_LO_AND              dest = source & dest
  2460.                        W3D_LO_AND_REVERSE      dest = source & !dest
  2461.                        W3D_LO_COPY             dest = source
  2462.                        W3D_LO_AND_INVERTED     dest = !source & dest
  2463.                        W3D_LO_NOOP             dest = dest
  2464.                        W3D_LO_XOR              dest = source ^ dest
  2465.                        W3D_LO_OR               dest = source | dest
  2466.                        W3D_LO_NOR              dest = !(source | dest)
  2467.                        W3D_LO_EQUIV            dest = !(source ^ dest)
  2468.                        W3D_LO_INVERT           dest = !dest
  2469.                        W3D_LO_OR_REVERSE       dest = source | !dest
  2470.                        W3D_LO_COPY_INVERTED    dest = !source
  2471.                        W3D_LO_OR_INVERTED      dest = !source | dest
  2472.                        W3D_LO_NAND             dest = !(source & dest)
  2473.                        W3D_LO_SET              dest = 1
  2474.  
  2475.    RESULT
  2476.        W3D_SUCCESS             Success
  2477.        W3D_ILLEGALINPUT        Wrong operation
  2478.        W3D_UNSUPPORTEDLOGICOP  Unsupported by current driver
  2479.        W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2480.  
  2481.    EXAMPLE
  2482.  
  2483.    NOTES
  2484.  
  2485.    BUGS
  2486.  
  2487.    SEE ALSO
  2488.  
  2489. Warp3D/W3D_SetPenMask                                          Warp3D/W3D_SetPenMask
  2490.  
  2491.    NAME
  2492.        W3D_SetPenMask -- set a pen mask for drawing operations
  2493.  
  2494.    SYNOPSIS
  2495.        ret = W3D_SetPenMask(context, indexmask)
  2496.        d0                   a0       d1
  2497.  
  2498.        ULONG W3D_SetPenMask(W3D_Context *, ULONG);
  2499.  
  2500.    FUNCTION
  2501.        This function defines the mask for all drawing operations in
  2502.        chunky modes (8 bit modes).
  2503.  
  2504.    INPUTS
  2505.        context     - The context to use
  2506.        indexmask   - A bitmask which is applied to chunky pixels
  2507.  
  2508.    RESULT
  2509.        W3D_SUCCESS             Success
  2510.        W3D_MASKNOTSUPPORTED    Masking is not supported by the current driver
  2511.        W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2512.  
  2513.    EXAMPLE
  2514.  
  2515.    NOTES
  2516.  
  2517.    BUGS
  2518.  
  2519.    SEE ALSO
  2520.        W3D_SetColorMask
  2521.  
  2522. Warp3D/W3D_SetScissor                                          Warp3D/W3D_SetScissor
  2523.  
  2524.    NAME
  2525.        W3D_SetScissor -- (Re-) Set the clipping rectangle
  2526.  
  2527.    SYNOPSIS
  2528.        W3D_SetScissor(context,scissor);
  2529.                        a0      a1
  2530.  
  2531.        void W3D_SetScissor(W3D_Context* context, W3D_Scissor* scissor);
  2532.  
  2533.    FUNCTION
  2534.        This function sets or resets the clipping rectangle while retaining
  2535.        the current drawing region.
  2536.  
  2537.    INPUTS
  2538.        context     -   The context structure
  2539.        scissor     -   A new scissor or NULL for full-screen/no clipping
  2540.  
  2541.    RESULT
  2542.  
  2543.    EXAMPLE
  2544.  
  2545.    NOTES
  2546.  
  2547.    BUGS
  2548.  
  2549.    SEE ALSO
  2550.        W3D_SetDrawRegion()
  2551.  
  2552. Warp3D/W3D_SetState                                              Warp3D/W3D_SetState
  2553.  
  2554.    NAME   
  2555.        W3D_SetState -- Enable or disable hardware and context states
  2556.  
  2557.    SYNOPSIS
  2558.        success = W3D_SetState(context, state, newstate);
  2559.        d0                     a0       d0     d1
  2560.  
  2561.        ULONG W3D_SetState(W3D_Context *, ULONG, ULONG);
  2562.  
  2563.    FUNCTION
  2564.        This function is used to enable or disable hardware
  2565.        effects or context states. Success or failure depends
  2566.        on the hardware`s ability to use the effect. Some
  2567.        hardware may not even be able to switch off some effects.
  2568.  
  2569.    INPUTS
  2570.        context     - pointer to a W3D_Context
  2571.        state       - state to be changed. Current states are listed here.
  2572.                      For a more detailed description, read the doc files.
  2573.                        W3D_AUTOTEXMANAGEMENT  automatic texture management
  2574.                        W3D_SYNCHRON           wait, until HW is idle
  2575.                        W3D_INDIRECT           buffer drawings until W3D_Flush()'ed
  2576.                        W3D_GLOBALTEXENV       global texture modes
  2577.                        W3D_DOUBLEHEIGHT       screen has double height
  2578.                        W3D_FAST               Drawing functions may modify passed st
  2579. ructures
  2580.                        W3D_TEXMAPPING         texmapping state
  2581.                        W3D_PERSPECTIVE        perspective correction state
  2582.                        W3D_GOURAUD            gouraud/flat shading
  2583.                        W3D_ZBUFFER            Z-Buffer state
  2584.                        W3D_ZBUFFERUPDATE      Z-Buffer update state
  2585.                        W3D_BLENDING           Alpha blending state
  2586.                        W3D_FOGGING            Fogging state
  2587.                        W3D_ANTI_POINT         Point antialiasing
  2588.                        W3D_ANTI_LINE          Line antialiasing
  2589.                        W3D_ANTI_POLYGON       Polygon antialiasing
  2590.                        W3D_ANTI_FULLSCREEN    Fullscreen antialiasing
  2591.                        W3D_DITHERING          dithering state
  2592.                        W3D_LOGICOP            logical operations state
  2593.                        W3D_STENCILBUFFER      stencil buffer state
  2594.                        W3D_ALPHATEST          alpha test operation
  2595.                        W3D_SPECULAR           Specular highlightung state
  2596.                        W3D_TEXMAPPING3D       3D texturemapping state
  2597.                        W3D_SCISSOR            Scissor test
  2598.        newstate    - indicates what should be done to the state bit:
  2599.                        W3D_ENABLE             try to switch this feature on
  2600.                        W3D_DISABLE            try to switch it off
  2601.  
  2602.    RESULT
  2603.        One of two constants:
  2604.            W3D_SUCCESS            the operation was successful
  2605.            W3D_UNSUPPORTEDSTATE   the operation can not be done
  2606.  
  2607.    EXAMPLE
  2608.        if (W3D_UNSUPPORTEDSTATE == W3D_SetState(context, W3D_ANTI_FULLSCREEN,
  2609.                                        W3D_ENABLE)) {
  2610.            printf("This hardware does not support fullscreen antialiasing\n");
  2611.        } else {
  2612.            printf("Fullscreen antialiasing enabled\n");
  2613.        }
  2614.  
  2615.    NOTES
  2616.        It's not required to check the return value, however, do not assume anything.
  2617.        The current hardware may not have any restrictions on using
  2618.        i.e. Z buffering, but future hardware may.
  2619.  
  2620.    BUGS
  2621.  
  2622.    SEE ALSO
  2623.        W3D_GetState, W3D_Query
  2624.  
  2625. Warp3D/W3D_SetStencilFunc                                  Warp3D/W3D_SetStencilFunc
  2626.  
  2627.    NAME
  2628.        W3D_SetStencilFunc -- Set stencil function
  2629.  
  2630.    SYNOPSIS
  2631.        success = W3D_SetStencilFunc(context, func, refvalue, mask);
  2632.        d0                           a0       d0    d1        d2
  2633.  
  2634.        ULONG W3D_SetStencilMode(W3D_Context *, ULONG, ULONG, ULONG);
  2635.  
  2636.    FUNCTION
  2637.        Set the stencil test function, as used by the OpenGL render pipeline.
  2638.        For more information, refer to the OpenGL specs.
  2639.  
  2640.    INPUTS
  2641.        context         - W3D context structure
  2642.        func            - stencil test function. Possible value are:
  2643.                            W3D_ST_NEVER         don't draw pixel
  2644.                            W3D_ST_ALWAYS        draw always
  2645.                            W3D_ST_LESS          draw, if refvalue < ST
  2646.                            W3D_ST_LEQUAL        draw, if refvalue <= ST
  2647.                            W3D_ST_EQUAL         draw, if refvalue == ST
  2648.                            W3D_ST_GEQUAL        draw, if refvalue >= ST
  2649.                            W3D_ST_GREATER       draw, if refvalue > ST
  2650.                            W3D_ST_NOTEQUAL      draw, if refvalue != ST
  2651.        refvalue        - reference value (0-255) used for the stencil test
  2652.        mask            - mask value applied to 'refvalue' and to the stencil buffer
  2653.                          content
  2654.  
  2655.    RESULT
  2656.        W3D_SUCCESS             Success
  2657.        W3D_ILLEGALINPUT        Illegal input
  2658.        W3D_UNSUPPORTEDSTTEST   Not supported by current driver
  2659.        W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2660.  
  2661.    EXAMPLE
  2662.  
  2663.    NOTES
  2664.        Stencil buffering is only supported by newer hardware
  2665.        Note that the stencil test has to be enabled using
  2666.        W3D_SetState.
  2667.  
  2668.    BUGS
  2669.  
  2670.    SEE ALSO
  2671.  
  2672. Warp3D/W3D_SetStencilOp                                      Warp3D/W3D_SetStencilOp
  2673.  
  2674.    NAME   
  2675.        W3D_SetStencilOp -- Set stencil operation
  2676.  
  2677.    SYNOPSIS
  2678.        success = W3D_SetStencilOp(context, sfail, dpfail, dppass);
  2679.        d0                         a0       d0     d1      d2
  2680.  
  2681.        ULONG W3D_SetStencilOp(W3D_Context *, ULONG, ULONG, ULONG);
  2682.  
  2683.    FUNCTION
  2684.        Set the stencil test operation, as used by the OpenGL render
  2685.        pipeline. For more information, refer to the OpenGL specs.
  2686.  
  2687.    INPUTS
  2688.        context         - context pointer
  2689.        dpfail          - action, if depth test fails
  2690.        dppass          - action, if depth test succeeds. Possible values are
  2691.                          (for all three mentioned cases):
  2692.                            W3D_ST_KEEP          keep stencil buffer value
  2693.                            W3D_ST_ZERO          clear stencil buffer value
  2694.                            W3D_ST_REPLACE       replace by reference value
  2695.                            W3D_ST_INCR          increment
  2696.                            W3D_ST_DECR          decrement
  2697.                            W3D_ST_INVERT        invert bitwise
  2698.  
  2699.    RESULT
  2700.        W3D_SUCCESS             Success
  2701.        W3D_ILLEGALINPUT        Illegal input
  2702.        W3D_UNSUPPORTEDSTTEST   Not supported by current driver
  2703.        W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2704.  
  2705.    EXAMPLE
  2706.  
  2707.    NOTES
  2708.        Stencil buffering is only supported on newer hardware.
  2709.        Note that the stencil test has to be enabled using
  2710.        W3D_SetState.
  2711.  
  2712.    BUGS
  2713.  
  2714.    SEE ALSO
  2715.  
  2716. Warp3D/W3D_SetTexEnv                                            Warp3D/W3D_SetTexEnv
  2717.  
  2718.    NAME   
  2719.        W3D_SetTexEnv -- Set texture environment parameters
  2720.  
  2721.    SYNOPSIS
  2722.        success = W3D_SetTexEnv(context, texture, envparam, envcolor);
  2723.        d0                      a0       a1       d1        a2
  2724.  
  2725.        ULONG W3D_SetTexEnv(W3D_Context *, W3D_Texture *, ULONG,
  2726.                W3D_Color *);
  2727.  
  2728.    FUNCTION
  2729.        This function is used to set the texture environment parameters.
  2730.        These parameters define how a texture is applied to a drawn
  2731.        primitive. This also involves lit-texturing, and unlit-texturing.
  2732.  
  2733.    INPUTS
  2734.        context     - a pointer to a W3D_Context (surprise !:)
  2735.        texture     - a pointer to the texture object to be modified
  2736.        envparam    - the environment parameter. One of the following:
  2737.                      W3D_REPLACE       Unlit texturing
  2738.                      W3D_DECAL         Lit texturing using the alpha component
  2739.                                        as blending value
  2740.                      W3D_MODULATE      Lit texturing by modulation of source
  2741.                                        and destination. Modulation means
  2742.                                        source and destination are multiplied.
  2743.                      W3D_BLEND         Blending with the color in envcolor.
  2744.        envcolor    - Only specified when envparam == W3D_BLEND. The
  2745.                      given color value is used for blending with the texture.
  2746.                      Must be NULL for all other envparams.
  2747.  
  2748.    RESULT
  2749.        A value indicating success or failure. Current values are:
  2750.            W3D_SUCCESS             (guess :)
  2751.            W3D_ILLEGALINPUT        Unknown envparam given
  2752.            W3D_UNSUPPORTEDTEXENV   Not supported by the current driver
  2753.            W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2754.  
  2755.    EXAMPLE
  2756.  
  2757.    NOTES
  2758.         The texture environment is texture-specific by default. By enabling
  2759.         the W3D_GLOBALTEXENV state using W3D_SetState() the texture environment
  2760.         can be made global for all textures (this is the case in OpenGL,
  2761.         for example).
  2762.  
  2763.    BUGS
  2764.  
  2765.    SEE ALSO
  2766.        W3D_GetTexFmtInfo
  2767.  
  2768. Warp3D/W3D_SetWrapMode                                        Warp3D/W3D_SetWrapMode
  2769.  
  2770.    NAME   
  2771.        W3D_SetWrapMode -- Set the texture`s wrapping mode
  2772.  
  2773.    SYNOPSIS
  2774.        success = W3D_SetWrapMode(context, texture, mode_s, mode_t, border);
  2775.        d0                        a0        a1      d0      d1      a2
  2776.  
  2777.        ULONG W3D_SetWrapMode(W3D_Context *, W3D_Texture *, ULONG,
  2778.                ULONG, W3D_Color *);
  2779.  
  2780.    FUNCTION
  2781.        Sets the texture`s wrapping mode.
  2782.  
  2783.    INPUTS
  2784.        context     - A W3D_Context pointer
  2785.        texture     - The texture to be modified
  2786.        mode_s      - The wrapping in s direction (vertical). Can be one
  2787.                      of the following constants:
  2788.                      W3D_REPEAT    Texture is repeated
  2789.                      W3D_CLAMP     Texture is clamped, the border is filled
  2790.                                    with the color given in border.
  2791.        mode_t      - Wrapping in t direction (horizontal). Same as above.
  2792.        border      - A pointer to a W3D_Color used for the border (when clamping).
  2793.  
  2794.    RESULT
  2795.        A value indicating success or failure. One of the following:
  2796.            W3D_SUCCESS             - Success
  2797.            W3D_ILLEGALINPUT        - Illegal wrap mode
  2798.            W3D_UNSUPPORTEDWRAPMODE - The desired wrap mode is not supported
  2799.                                      by the current driver
  2800.  
  2801.    EXAMPLE
  2802.  
  2803.    NOTES
  2804.         The Virge does not allow asymmetric wrapping, therefore you should
  2805.         use the query facility, if asymmetric wrapping is possible.
  2806.  
  2807.         You should usually use W3D_REPEAT, since W3D_CLAMP is currently
  2808.         not possible with the Virge.
  2809.  
  2810.    BUGS
  2811.  
  2812.    SEE ALSO
  2813.        W3D_Query, W3D_GetTexFmtInfo
  2814.  
  2815. Warp3D/W3D_SetWriteMask                                      Warp3D/W3D_SetWriteMask
  2816.  
  2817.    NAME   
  2818.        W3D_SetWriteMask -- write protext bits in the stencil buffer
  2819.  
  2820.    SYNOPSIS
  2821.        success = W3D_SetWriteMask(context, mask);
  2822.        d0                         a0       d1
  2823.  
  2824.        ULONG W3D_SetWriteMask(W3D_Context *, ULONG);
  2825.  
  2826.    FUNCTION
  2827.        Defines which bits of the stencil buffer are write protected
  2828.  
  2829.    INPUTS
  2830.        context - context pointer
  2831.        mask    - a bitmask, indicationg which bits of the
  2832.                  stencil buffer should be write-protected.
  2833.                  Setting a bit to 1 allows write access,
  2834.                  while a 0 bit protects it from writing
  2835.  
  2836.    RESULT
  2837.        W3D_SUCCESS             success
  2838.        W3D_UNSOPPORTEDTEST     Not supported by current driver
  2839.        W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2840.  
  2841.    EXAMPLE
  2842.  
  2843.    NOTES
  2844.        Stencil buffering is only supported on newer hardware.
  2845.        Note that the stencil test has to be enabled using
  2846.        W3D_SetState.
  2847.  
  2848.    BUGS
  2849.  
  2850.    SEE ALSO
  2851.  
  2852. Warp3D/W3D_SetZCompareMode                                Warp3D/W3D_SetZCompareMode
  2853.  
  2854.    NAME   
  2855.        W3D_SetZCompareMode -- Set the ZBuffer compare mode
  2856.  
  2857.    SYNOPSIS
  2858.        success = W3D_SetZCompareMode(context, mode);
  2859.        d0                            a0       d1
  2860.  
  2861.        ULONG W3D_SetZCompareMode(W3d_Context *, ULONG);
  2862.  
  2863.    FUNCTION
  2864.        Set the compare mode used by ZBuffering. This mode
  2865.        determines what will be drawn depending on the z coordinate
  2866.        of the primitive to be drawn, and the value currently
  2867.        in the ZBuffer. For more information on ZBuffering, see the
  2868.        OpenGL specs, or get a textbook about Computer Graphics.
  2869.  
  2870.    INPUTS
  2871.        context - A context pointer
  2872.        mode    - The ZBuffer compare mode. One of the following values:
  2873.                    W3D_Z_NEVER             Never pass, discard pixel
  2874.                    W3D_Z_LESS              Draw if z < zbuffer
  2875.                    W3D_Z_GEQUAL            Draw if z >= zbuffer
  2876.                    W3D_Z_LEQUAL            Draw if z <= zbuffer
  2877.                    W3D_Z_GREATER           Draw if z > zbuffer
  2878.                    W3D_Z_NOTEQUAL          Draw if z != zbuffer
  2879.                    W3D_Z_EQUAL             Draw if Z == zbuffer
  2880.                    W3D_Z_ALWAYS            Always draw
  2881.  
  2882.    RESULT
  2883.        One of the following values:
  2884.            W3D_SUCCESS         Operation successful
  2885.            W3D_ILLEGLAINPUT    Illegal compare mode
  2886.            W3D_UNSUPPORTEDZCMP Comparemode unsupported by current driver
  2887.            W3D_NOTVISIBLE      Indirect mode only. Locking failed.
  2888.  
  2889.    EXAMPLE
  2890.  
  2891.    NOTES
  2892.        W3D_Z_LESS is the "normal" behavior (i.e. depth cueing), while
  2893.        W3D_Z_NOTEQUAL can be used as a poor man's stencil buffering.
  2894.  
  2895.        When mixing software and hardware rendering (for example in OpenGL
  2896.        implementations, then you should be aware, that using some of
  2897.        the Z compare modes (i.e. W3D_Z_EQUAL, W3D_Z_NOTEQUAL) might not
  2898.        work correctly, since the results of the software engine might
  2899.        not be exactly the same as the results of the hardware engine.
  2900.  
  2901.  
  2902.    BUGS
  2903.  
  2904.    SEE ALSO
  2905.        W3D_ClearZBuffer
  2906.  
  2907. Warp3D/W3D_TestMode                                              Warp3D/W3D_TestMode
  2908.  
  2909.    NAME
  2910.        W3D_TestMode -- Test Mode and return driver (V2)
  2911.  
  2912.    SYNOPSIS
  2913.        driver = W3D_TestMode(modeid);
  2914.           D0                  D0
  2915.  
  2916.        W3D_Driver *W3D_TestMode(ULONG);
  2917.  
  2918.    FUNCTION
  2919.        Given a standard ModeID, this function tests if there is a
  2920.        driver available for this DisplayID. A hardware driver is
  2921.        preferred, although it will return a CPU driver (if found)
  2922.        in case none of the installed hardware drivers support this
  2923.        screenmode.
  2924.  
  2925.    INPUTS
  2926.        modeid  -   A standard AmigaOS DisplayID
  2927.  
  2928.    RESULT
  2929.        driver  -   A pointer to a suitable driver or NULL if
  2930.                    no matching or CPU driver found.
  2931.  
  2932.    EXAMPLE
  2933.  
  2934.    NOTES
  2935.        This function will also check if the CPU driver actually supports
  2936.        this format, so be prepared to check for a NULL return value.
  2937.  
  2938.    BUGS
  2939.  
  2940.    SEE ALSO
  2941.        W3D_GetDrivers
  2942.  
  2943. Warp3D/W3D_UnLockHardware                                  Warp3D/W3D_UnLockHardware
  2944.  
  2945.    NAME   
  2946.        W3D_UnLockHardware -- Release the exclusive hardware lock
  2947.  
  2948.    SYNOPSIS
  2949.        W3D_UnLockHardware(context);
  2950.                           a0
  2951.  
  2952.        void W3D_UnLockHardware(W3D_Context *);
  2953.  
  2954.    FUNCTION
  2955.        This function releases a hardware lock previously acquired
  2956.        with W3D_LockHardware.
  2957.  
  2958.    INPUTS
  2959.        context - a pointer to a W3D_Context
  2960.  
  2961.    RESULT
  2962.        None
  2963.  
  2964.    EXAMPLE
  2965.        if (W3D_SUCCESS == W3D_LockHardware(context) {
  2966.            ...
  2967.            Render some stuff
  2968.            ...
  2969.            W3D_UnLockHardware(context);
  2970.        } else {
  2971.            printf("Can`t lock hardware\n");
  2972.        }
  2973.  
  2974.    NOTES
  2975.  
  2976.    BUGS
  2977.  
  2978.    SEE ALSO
  2979.        W3D_LockHardware, W3D_GetState
  2980.  
  2981. Warp3D/W3D_UpdateTexImage                                  Warp3D/W3D_UpdateTexImage
  2982.  
  2983.    NAME   
  2984.        W3D_UpdateTexImage -- Change the image of a texture or mipmap
  2985.  
  2986.    SYNOPSIS
  2987.        success = W3D_UpdateTexImage(context, texture, teximage, level, palette);
  2988.        d0                           a0       a1       a2        d1     a3
  2989.  
  2990.        ULONG W3D_UpdateTexImage(W3D_Context *, W3D_Texture *, void *,
  2991.                ULONG, ULONG *);
  2992.  
  2993.    FUNCTION
  2994.        Change the image mipmap data to the given texture. The new source
  2995.        image must have dimensions and format equal to the old one. Also,
  2996.        mipmap mode must be the same (meaning that if the old texture had
  2997.        mipmaps, so must the new).
  2998.        The resident state is unaffected. If the texture is in video ram,
  2999.        the copy there will be replaced by the new image as soon as the
  3000.        texture is used again for rendering.
  3001.  
  3002.    INPUTS
  3003.        context     - a pointer to the current context
  3004.        texture     - a pointer to the texture to be modified
  3005.        teximage    - a pointer to the new image data
  3006.        level       - the texture level to be changed. 0 is the source image,
  3007.                      while levels != 0 are the mipmaps.
  3008.        palette     - a pointer to a palette, if needed. May be NULL, even if
  3009.                      the texture is chunky, in which case the old palette
  3010.                      will remain valid. See the note to the W3D_ATO_PALETTE
  3011.                      tag in W3D_AllocTexObject for some constraints on using
  3012.                      chunky textures on 8bit screens
  3013.  
  3014.    RESULT
  3015.        One of the following:
  3016.            W3D_SUCCESS     Success
  3017.            W3D_NOMEMORY    No memory left
  3018.            W3D_NOMIPMAPS   Mipmaps are not supported by this texture object
  3019.            W3D_NOTVISIBLE  (Indirect context only) Flushing failed due to failed
  3020.                            hardware locking
  3021.  
  3022.    EXAMPLE
  3023.  
  3024.    NOTES
  3025.         Update operations are expensive, when done very often, because of
  3026.         the bus bandwidth limitation. Be especially careful when using
  3027.         texture animations. On hardware with a lot of VRAM, it might be
  3028.         better to treat all frames of such an animation as separate
  3029.         textures, so that all (or most of them) might be in VRAM.
  3030.  
  3031.    BUGS
  3032.  
  3033.    SEE ALSO
  3034.        W3D_AllocTexObj
  3035.  
  3036. Warp3D/W3D_UpdateTexSubImage                            Warp3D/W3D_UpdateTexSubImage
  3037.  
  3038.    NAME
  3039.        W3D_UpdateTexSubImage -- Change part of a texture
  3040.  
  3041.    SYNOPSIS
  3042.        success = W3D_UpdateTexSubImage(context, texture, teximage, level,
  3043.        d0                              a0       a1       a2        d1
  3044.                         palette, scissor, srcbpr);
  3045.                         a3       a4       d0
  3046.  
  3047.        ULONG W3D_UpdateTexImage(W3D_Context *, W3D_Texture *, void *,
  3048.                ULONG, ULONG *, W3D_Scissor*, ULONG);
  3049.  
  3050.    FUNCTION
  3051.        Update only part of a texture, as defined by the scissor region.
  3052.        The image data is assumed to be as large as the scissor region.
  3053.        If it's larger, the srcbpr parameter can be used to define the number
  3054.        of bytes per source row. If teximage is non-zero, the contents is copied
  3055.        into the texture. It can also be set to NULL. In this case, you can alter
  3056.        the texture image yourself in the following way: The pointer supplied with
  3057.        W3D_AllocTexObj/W3D_UpdateTexImage points to your supplied image data. You
  3058.        are allowed to change this data, BUT you MUST call W3D_UpdateTexSubImage
  3059.        after changing BEFORE doing anything else. This call must not be used inside
  3060.        a W3D_LockHardware/W3D_UnLockHardware pair. The scissor is then
  3061.        considered a "damage region", and the area defined by it will be updated.
  3062.  
  3063.        This function also recreates mipmaps, also only restricted to the scissor
  3064.        region.
  3065.  
  3066.    INPUTS
  3067.        context     - a pointer to the current context
  3068.        texture     - a pointer to the texture to be modified
  3069.        teximage    - a pointer to the new image data. Note that this pointer
  3070.                      is only "temporary", it may be reused immediatly. This is
  3071.                      different from the W3D_UpdateTexImage call.
  3072.        level       - the texture level to be changed. 0 is the source image,
  3073.                      while levels != 0 are the mipmaps.
  3074.        palette     - a pointer to a palette, if needed. May be NULL, even if
  3075.                      the texture is chunky, in which case the old palette
  3076.                      will remain valid. See the note to the W3D_ATO_PALETTE
  3077.                      tag in W3D_AllocTexObject for some constraints on using
  3078.                      chunky textures on 8bit screens
  3079.        scissor     - The given image data will be transfered into this region.
  3080.        srcbpr      - Bytes per row in source image. May be set to zero to indicate
  3081.                      that image data ans scissor size match.
  3082.  
  3083.    RESULT
  3084.        One of the following:
  3085.            W3D_SUCCESS     Success
  3086.            W3D_NOMEMORY    No memory left
  3087.            W3D_NOMIPMAPS   Mipmaps are not supported by this texture object,
  3088.                            or no mipmaps have been created yet.
  3089.            W3D_NOTVISIBLE  (Indirect context only) Flushing failed due to failed
  3090.                            hardware locking
  3091.  
  3092.    EXAMPLE
  3093.  
  3094.    NOTES
  3095.         Update operations are expensive, when done very often, because of
  3096.         the bus bandwidth limitation. Be especially careful when using
  3097.         texture animations. On hardware with a lot of VRAM, it might be
  3098.         better to treat all frames of such an animation as separate
  3099.         textures, so that all (or most of them) might be in VRAM.
  3100.  
  3101.    BUGS
  3102.  
  3103.    SEE ALSO
  3104.        W3D_AllocTexObj, W3D_UpdateTexImage
  3105.  
  3106. Warp3D/W3D_UploadTexture                                    Warp3D/W3D_UploadTexture
  3107.  
  3108.    NAME   
  3109.        W3D_UploadTexture -- Transfer a texture to video ram
  3110.  
  3111.    SYNOPSIS
  3112.        success = W3D_UploadTexture(context, texture);
  3113.        d0                          a0       a1
  3114.  
  3115.        ULONG W3D_UploadTexture(W3D_Context *, W3D_Texture *);
  3116.  
  3117.    FUNCTION
  3118.        `Upload` a texture to video ram. Video memory is allocated and
  3119.        the texture image is copied there. The source texture stays in
  3120.        main memory.
  3121.  
  3122.    INPUTS
  3123.        context - a W3D_Context
  3124.        texture - the W3D_Texture to be transfered
  3125.  
  3126.    RESULT
  3127.        A value indication success or failure. One of the following:
  3128.            W3D_SUCCESS     It worked.
  3129.            W3D_NOGFXMEM    No video ram remaining.
  3130.  
  3131.    EXAMPLE
  3132.  
  3133.    NOTES
  3134.        This function does nothing when W3D_AUTOTEXMANAGEMENT is set
  3135.        in the current context`s state. Note also that transferring
  3136.        textures to video ram means transfer over the hardware`s bus
  3137.        system. Although newer cards like the CVPPC will have a PCI
  3138.        or similar bus, those bus system are still considered
  3139.        `bottlenecks`, and are usually much slower than main memory
  3140.        transfers. It is advised that you use automatic texture management,
  3141.        as this uses a LRU caching scheme. This was also used in
  3142.        ADescent, and gave about 99.7 % hit ratio.
  3143.  
  3144.    BUGS
  3145.  
  3146.    SEE ALSO
  3147.        W3D_ReleaseTexture, W3D_FlushTexture.
  3148.  
  3149. Warp3D/W3D_WaitIdle                                              Warp3D/W3D_WaitIdle
  3150.  
  3151.    NAME   
  3152.        W3D_WaitIdle -- Wait for the hardware to become idle
  3153.  
  3154.    SYNOPSIS
  3155.        W3D_WaitIdle(context);
  3156.                     a0
  3157.  
  3158.        void W3D_WaitIdle(W3D_Context *);
  3159.  
  3160.    FUNCTION
  3161.        This function waits for the hardware to finish it`s current
  3162.        operation. It blocks your program until then.
  3163.  
  3164.    INPUTS
  3165.        context - a pointer to W3D_Context
  3166.  
  3167.    RESULT
  3168.        None
  3169.  
  3170.    EXAMPLE
  3171.        W3D_DrawSomething(context);
  3172.        W3D_WaitIdle(context);
  3173.        printf("Hardware is free again\n");
  3174.  
  3175.    NOTES
  3176.        You should use this function instead of W3D_CheckIdle if you
  3177.        just want to wait for the hardware. This function may use
  3178.        signals and/or interrupts for waiting, letting the CPU take care
  3179.        of other tasks while waiting
  3180.  
  3181.        Usually you won't need to call this function, since W3D takes care,
  3182.        that any drawing operation is only done, if the hardware is
  3183.        ready to get a new job.
  3184.  
  3185.    BUGS
  3186.  
  3187.    SEE ALSO
  3188.        W3D_CheckIdle
  3189.  
  3190. Warp3D/W3D_WriteStencilPixel                            Warp3D/W3D_WriteStencilPixel
  3191.  
  3192.    NAME   
  3193.        W3D_WriteStencilPixel -- Write a pixel into the stencil buffer
  3194.  
  3195.    SYNOPSIS
  3196.        res = W3D_WriteStencilBuffer(context, x, y, st);
  3197.        d0                           a0       d0 d1 d2
  3198.  
  3199.        ULONG W3D_WriteStencilBuffer(W3D_Context *, ULONG, ULONG, ULONG);
  3200.  
  3201.    FUNCTION
  3202.        This function writes the pixel st into the stencil buffer of context,
  3203.        at position x,y.
  3204.        This function may only be used while the hardware is locked,
  3205.        except when indirect drawing is used.
  3206.  
  3207.    INPUTS
  3208.        context - a context pointer
  3209.        x,y     - position to write to
  3210.        st      - the pixel value
  3211.  
  3212.    RESULT
  3213.        A constant indicating success or failure. One of the following:
  3214.            W3D_SUCCESS             Success
  3215.            W3D_NOSTENCILBUFFER     Stencil buffering not supported by
  3216.                                      current driver
  3217.            W3D_NOTVISIBLE          The stencil buffer can not be accessed by
  3218.                                        the hardware
  3219.  
  3220.    EXAMPLE
  3221.  
  3222.    NOTES
  3223.        Stencil buffering is not supported on older hardware.
  3224.  
  3225.        This function is primarly intended for OpenGL implementations,
  3226.        which might need access to the stencil buffer. This function
  3227.        is slow and should normally not be called.
  3228.  
  3229.        Important note: In indirect mode you have to make sure, that
  3230.        the stencil buffer is up to date, no Flush is internally done
  3231.        by this function. You have to call W3D_Flush, if the stencil
  3232.        buffer is not up to date yet.
  3233.  
  3234.    BUGS
  3235.        Indirect mode: the hardware is internally not locked for
  3236.        performance reasons, therefore the result might be wrong, if
  3237.        the corresponding buffer is swapped out.
  3238.  
  3239.    SEE ALSO
  3240.        W3D_AllocStencilBuffer
  3241.  
  3242. Warp3D/W3D_WriteStencilSpan                              Warp3D/W3D_WriteStencilSpan
  3243.  
  3244.    NAME   
  3245.        W3D_WriteStencilSpan -- Write a span of stencil pixels
  3246.  
  3247.    SYNOPSIS
  3248.        success = W3D_WriteStencilSpan(context, x, y, n, st, mask);
  3249.        d0                             a0       d0 d1 d2 a1  a2
  3250.  
  3251.        ULONG W3D_WriteStencilSpan(W3D_Context *, ULONG, ULONG, ULONG,
  3252.                        ULONG [], UBYTE []);
  3253.  
  3254.    FUNCTION
  3255.        Write a span of n stencil pixels into the stencil buffer, starting
  3256.        at x,y. Pixels are taken from st. The mask array is used to skip pixels:
  3257.        If a byte is set to 0, the corresponding pixel is not written.
  3258.        This function may only be used while the hardware is locked,
  3259.        except when indirect drawing is used.
  3260.  
  3261.    INPUTS
  3262.        context - a context pointer
  3263.        x,y     - starting coordinates
  3264.        n       - number of pixels
  3265.        st      - array of stencil pixels
  3266.        mask    - mask array. May be NULL
  3267.  
  3268.    RESULT
  3269.        A constant indicating success or failure. One of the following:
  3270.            W3D_SUCCESS             Success
  3271.            W3D_NOSTENCILBUFFER     Stencil buffering not supported by
  3272.                                      current driver
  3273.            W3D_NOTVISIBLE          The stencil buffer can not be accessed by
  3274.                                        the hardware
  3275.  
  3276.    EXAMPLE
  3277.  
  3278.    NOTES
  3279.        Stencil buffering is not supported on older hardware.
  3280.  
  3281.        This function is primarly intended for OpenGL implementations,
  3282.        which might need access to the stencil buffer. This function
  3283.        is slow and should normally not be called.
  3284.  
  3285.        Important note: In indirect mode you have to make sure, that
  3286.        the stencil buffer is up to date, no Flush is internally done
  3287.        by this function. You have to call W3D_Flush, if the stencil
  3288.        buffer is not up to date yet.
  3289.  
  3290.    BUGS
  3291.        Indirect mode: the hardware is internally not locked for
  3292.        performance reasons, therefore the result might be wrong, if
  3293.        the corresponding buffer is swapped out.
  3294.  
  3295.    SEE ALSO
  3296.  
  3297. Warp3D/W3D_WriteZPixel                                        Warp3D/W3D_WriteZPixel
  3298.  
  3299.    NAME   
  3300.        W3D_WriteZPixel -- Write a pixel into the ZBuffer
  3301.  
  3302.    SYNOPSIS
  3303.        success = W3D_WriteZPixel(context, x, y, z);
  3304.        d0                        a0       d0 d1 a1
  3305.  
  3306.        ULONG W3D_WriteZBuffer(W3D_Context *, ULONG, ULONG, W3D_Double *);
  3307.  
  3308.    FUNCTION
  3309.        Write  ZBuffer pixel z into context's ZBuffer, at x,y.
  3310.        This function may only be used while the hardware is locked,
  3311.        except when indirect drawing is used.
  3312.  
  3313.    INPUTS
  3314.        context - The context
  3315.        x,y     - Coordinates of the pixel
  3316.        z       - Pointer to a W3D_Double that's put into the zbuffer
  3317.  
  3318.    RESULT
  3319.  
  3320.    EXAMPLE
  3321.  
  3322.    NOTES
  3323.        This function is primarly intended for OpenGL implementations,
  3324.        which might need access to the Z buffer. This function
  3325.        is slow and should normally not be called.
  3326.  
  3327.        * IMPORTANT NOTE: *
  3328.        For speed reasons, this call is *NOT* compatible with indirect drawing.
  3329.        To use this call with indirect mode, you have to manually W3D_Flush,
  3330.        and, should you use any drawing calls, you'll have to W3D_Flush again.
  3331.  
  3332.    BUGS
  3333.        Indirect mode: the hardware is internally not locked for
  3334.        performance reasons, therefore the result might be wrong, if
  3335.        the corresponding buffer is swapped out.
  3336.  
  3337.    SEE ALSO
  3338.  
  3339. Warp3D/W3D_WriteZSpan                                          Warp3D/W3D_WriteZSpan
  3340.  
  3341.    NAME   
  3342.        W3D_WriteZSpan -- Write a span of z pixels
  3343.  
  3344.    SYNOPSIS
  3345.        W3D_WriteZSpan(context, x, y, n, z, mask);
  3346.                       a0       d0 d1 d2 a1 a2
  3347.  
  3348.        W3D_WriteZSpan(W3D_Context *, ULONG, ULONG, ULONG,
  3349.                    W3D_Double [], UBYTE []);
  3350.  
  3351.    FUNCTION
  3352.        Write a span of pixels pointed to by z into the zbuffer.
  3353.        Writing begins at x,y, n pixels will be drawn. mask points
  3354.        to an equally sized array of UBYTES. A 0 in the array indicates
  3355.        that the corresponding z pixel will not be drawn.
  3356.        This function may only be used while the hardware is locked,
  3357.        except when indirect drawing is used.
  3358.  
  3359.    INPUTS
  3360.        context - a context pointer
  3361.        x,y     - the starting position
  3362.        n       - number of pixels
  3363.        z       - pointer to a span of zpixels
  3364.        mask    - pointer to mask array. May be NULL
  3365.  
  3366.    RESULT
  3367.  
  3368.    EXAMPLE
  3369.  
  3370.    NOTES
  3371.        This function is primarly intended for OpenGL implementations,
  3372.        which might need access to the Z buffer. This function
  3373.        is slow and should normally not be called.
  3374.  
  3375.        * IMPORTANT NOTE: *
  3376.        For speed reasons, this call is *NOT* compatible with indirect drawing.
  3377.        To use this call with indirect mode, you have to manually W3D_Flush,
  3378.        and, should you use any drawing calls, you'll have to W3D_Flush again.
  3379.  
  3380.    BUGS
  3381.        Indirect mode: the hardware is internally not locked for
  3382.        performance reasons, therefore the result might be wrong, if
  3383.        the corresponding buffer is swapped out.
  3384.  
  3385.    SEE ALSO
  3386.  
  3387.